GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

test_dom-objects-enumeration.py 25.8 KB
Newer Older
1 2 3 4 5 6
# This test enumerates all DOM objects exposed in the global namespace
# and produce an error if one of them is not in the expected list.
#
# This test has been suggested in the iSEC partners' report:
# https://blog.torproject.org/blog/isec-partners-conducts-tor-browser-hardening-study

7
import testsuite
8

9
class Test(testsuite.TorBrowserTest):
10
    def setUp(self):
11
        testsuite.TorBrowserTest.setUp(self)
12 13
        self.marionette.set_pref("network.proxy.allow_hijacking_localhost", False)
        self.test_page_file_url = self.marionette.absolute_url("dom-objects-enumeration.html?testType=window")
14
        # The list of expected DOM objects
15
        self.expectedObjects = [
16 17
                "AbortController",
                "AbortSignal",
18
                "AbstractRange",
19 20 21 22 23
                "addEventListener",
                "alert",
                "Animation",
                "AnimationEffect",
                "AnimationEvent",
24
                "AnimationPlaybackEvent",
25 26 27 28
                "AnimationTimeline",
                "Array",
                "ArrayBuffer",
                "atob",
29
                "Atomics",
30 31
                "Attr",
                "Audio",
32
                "AudioParamMap",
33
                "AudioScheduledSourceNode",
34 35
                "AudioWorklet",
                "AudioWorkletNode",
36
                "BarProp",
37
                "BaseAudioContext",
38
                "BeforeUnloadEvent",
39 40 41
                "BigInt",
                "BigInt64Array",
                "BigUint64Array",
42 43 44 45 46 47
                "Blob",
                "BlobEvent",
                "blur",
                "Boolean",
                "BroadcastChannel",
                "btoa",
48
                "ByteLengthQueuingStrategy",
49 50 51
                "Cache",
                "caches",
                "CacheStorage",
52
                "cancelAnimationFrame",
53
                "cancelIdleCallback",
54
                "CanvasCaptureMediaStream",
55 56 57 58 59 60 61 62 63
                "CanvasGradient",
                "CanvasPattern",
                "CanvasRenderingContext2D",
                "captureEvents",
                "CaretPosition",
                "CDATASection",
                "CharacterData",
                "clearInterval",
                "clearTimeout",
64
                "Clipboard",
65 66 67 68 69 70 71 72
                "ClipboardEvent",
                "close",
                "closed",
                "CloseEvent",
                "Comment",
                "CompositionEvent",
                "confirm",
                "console",
73
                "constructor",
74
                "content",
75
                "CountQueuingStrategy",
76
                "createImageBitmap",
77
                "crossOriginIsolated",
78 79 80 81 82
                "crypto",
                "Crypto",
                "CryptoKey",
                "CSS",
                "CSS2Properties",
83
                "CSSAnimation",
84 85 86 87 88 89
                "CSSConditionRule",
                "CSSCounterStyleRule",
                "CSSFontFaceRule",
                "CSSFontFeatureValuesRule",
                "CSSGroupingRule",
                "CSSImportRule",
90 91
                "CSSKeyframeRule",
                "CSSKeyframesRule",
92 93
                "CSSMediaRule",
                "CSSMozDocumentRule",
94
                "CSSNamespaceRule",
95 96 97 98 99 100 101
                "CSSPageRule",
                "CSSRule",
                "CSSRuleList",
                "CSSStyleDeclaration",
                "CSSStyleRule",
                "CSSStyleSheet",
                "CSSSupportsRule",
102 103 104
                "CSSTransition",
                "CustomElementRegistry",
                "customElements",
105 106
                "CustomEvent",
                "DataTransfer",
107 108
                "DataTransferItem",
                "DataTransferItemList",
109 110 111 112
                "DataView",
                "Date",
                "decodeURI",
                "decodeURIComponent",
113 114
                "__defineGetter__",
                "__defineSetter__",
115 116 117
                "DeviceMotionEvent",
                "DeviceOrientationEvent",
                "devicePixelRatio",
118
                "Directory",
119 120 121 122
                "dispatchEvent",
                "document",
                "Document",
                "DocumentFragment",
123
                "DocumentTimeline",
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
                "DocumentType",
                "DOMException",
                "DOMImplementation",
                "DOMMatrix",
                "DOMMatrixReadOnly",
                "DOMParser",
                "DOMPoint",
                "DOMPointReadOnly",
                "DOMQuad",
                "DOMRect",
                "DOMRectList",
                "DOMRectReadOnly",
                "DOMRequest",
                "DOMStringList",
                "DOMStringMap",
                "DOMTokenList",
                "DragEvent",
                "dump",
                "Element",
                "encodeURI",
                "encodeURIComponent",
                "Error",
                "ErrorEvent",
                "escape",
                "eval",
                "EvalError",
150
                "event",
151 152 153 154
                "Event",
                "EventSource",
                "EventTarget",
                "external",
155
                "fetch",
156 157 158
                "File",
                "FileList",
                "FileReader",
159 160 161 162 163
                "FileSystem",
                "FileSystemDirectoryEntry",
                "FileSystemDirectoryReader",
                "FileSystemEntry",
                "FileSystemFileEntry",
164 165 166 167 168 169
                "find",
                "Float32Array",
                "Float64Array",
                "focus",
                "FocusEvent",
                "FontFace",
170
                "FontFaceSet",
boklm's avatar
boklm committed
171
                "FontFaceSetLoadEvent",
172
                "FormData",
173
                "FormDataEvent",
174 175 176 177 178
                "frameElement",
                "frames",
                "fullScreen",
                "Function",
                "Gamepad",
179
                "GamepadButton",
180
                "GamepadEvent",
181 182
                "GamepadHapticActuator",
                "GamepadPose",
183 184 185 186
                "Geolocation",
                "GeolocationCoordinates",
                "GeolocationPosition",
                "GeolocationPositionError",
187 188 189
                "getComputedStyle",
                "getDefaultComputedStyle",
                "getSelection",
190
                "globalThis",
191
                "HashChangeEvent",
192
                "hasOwnProperty",
193
                "Headers",
194 195 196 197 198 199 200 201 202 203 204 205 206 207
                "history",
                "History",
                "HTMLAllCollection",
                "HTMLAnchorElement",
                "HTMLAreaElement",
                "HTMLAudioElement",
                "HTMLBaseElement",
                "HTMLBodyElement",
                "HTMLBRElement",
                "HTMLButtonElement",
                "HTMLCanvasElement",
                "HTMLCollection",
                "HTMLDataElement",
                "HTMLDataListElement",
208
                "HTMLDetailsElement",
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
                "HTMLDirectoryElement",
                "HTMLDivElement",
                "HTMLDListElement",
                "HTMLDocument",
                "HTMLElement",
                "HTMLEmbedElement",
                "HTMLFieldSetElement",
                "HTMLFontElement",
                "HTMLFormControlsCollection",
                "HTMLFormElement",
                "HTMLFrameElement",
                "HTMLFrameSetElement",
                "HTMLHeadElement",
                "HTMLHeadingElement",
                "HTMLHRElement",
                "HTMLHtmlElement",
                "HTMLIFrameElement",
                "HTMLImageElement",
                "HTMLInputElement",
                "HTMLLabelElement",
                "HTMLLegendElement",
                "HTMLLIElement",
                "HTMLLinkElement",
                "HTMLMapElement",
233
                "HTMLMarqueeElement",
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
                "HTMLMediaElement",
                "HTMLMenuElement",
                "HTMLMenuItemElement",
                "HTMLMetaElement",
                "HTMLMeterElement",
                "HTMLModElement",
                "HTMLObjectElement",
                "HTMLOListElement",
                "HTMLOptGroupElement",
                "HTMLOptionElement",
                "HTMLOptionsCollection",
                "HTMLOutputElement",
                "HTMLParagraphElement",
                "HTMLParamElement",
                "HTMLPictureElement",
                "HTMLPreElement",
                "HTMLProgressElement",
                "HTMLQuoteElement",
                "HTMLScriptElement",
                "HTMLSelectElement",
254
                "HTMLSlotElement",
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
                "HTMLSourceElement",
                "HTMLSpanElement",
                "HTMLStyleElement",
                "HTMLTableCaptionElement",
                "HTMLTableCellElement",
                "HTMLTableColElement",
                "HTMLTableElement",
                "HTMLTableRowElement",
                "HTMLTableSectionElement",
                "HTMLTemplateElement",
                "HTMLTextAreaElement",
                "HTMLTimeElement",
                "HTMLTitleElement",
                "HTMLTrackElement",
                "HTMLUListElement",
                "HTMLUnknownElement",
                "HTMLVideoElement",
                "IDBCursor",
                "IDBCursorWithValue",
                "IDBDatabase",
                "IDBFactory",
                "IDBFileHandle",
                "IDBFileRequest",
                "IDBIndex",
                "IDBKeyRange",
                "IDBMutableFile",
                "IDBObjectStore",
                "IDBOpenDBRequest",
                "IDBRequest",
                "IDBTransaction",
                "IDBVersionChangeEvent",
286
                "IdleDeadline",
287
                "Image",
288
                "ImageBitmap",
289
                "ImageBitmapRenderingContext",
290 291 292 293 294 295 296 297 298 299 300
                "ImageData",
                "indexedDB",
                "Infinity",
                "innerHeight",
                "innerWidth",
                "InputEvent",
                "InstallTrigger",
                "Int16Array",
                "Int32Array",
                "Int8Array",
                "InternalError",
301 302
                "IntersectionObserver",
                "IntersectionObserverEntry",
303 304 305
                "Intl",
                "isFinite",
                "isNaN",
306
                "isPrototypeOf",
307
                "isSecureContext",
308 309 310
                "JSON",
                "KeyboardEvent",
                "KeyEvent",
311
                "KeyframeEffect",
312 313 314 315 316
                "length",
                "localStorage",
                "location",
                "Location",
                "locationbar",
317 318
                "__lookupGetter__",
                "__lookupSetter__",
319 320 321
                "Map",
                "matchMedia",
                "Math",
322 323 324
                "MathMLElement",
                "MediaCapabilities",
                "MediaCapabilitiesInfo",
325
                "MediaEncryptedEvent",
326
                "MediaError",
327 328
                "MediaKeyError",
                "MediaKeyMessageEvent",
329
                "MediaKeys",
330 331 332
                "MediaKeySession",
                "MediaKeyStatusMap",
                "MediaKeySystemAccess",
333 334
                "MediaList",
                "MediaQueryList",
335
                "MediaQueryListEvent",
336
                "MediaRecorder",
337
                "MediaRecorderErrorEvent",
338
                "MediaSource",
339 340
                "MediaStream",
                "MediaStreamTrack",
341
                "MediaStreamTrackEvent",
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
                "menubar",
                "MessageChannel",
                "MessageEvent",
                "MessagePort",
                "MimeType",
                "MimeTypeArray",
                "MouseEvent",
                "MouseScrollEvent",
                "moveBy",
                "moveTo",
                "mozInnerScreenX",
                "mozInnerScreenY",
                "MutationEvent",
                "MutationObserver",
                "MutationRecord",
                "name",
                "NamedNodeMap",
                "NaN",
                "navigator",
                "Navigator",
                "netscape",
                "Node",
                "NodeFilter",
                "NodeIterator",
                "NodeList",
                "Notification",
                "NotifyPaintEvent",
                "Number",
                "Object",
                "onabort",
372
                "onabsolutedeviceorientation",
373
                "onafterprint",
374
                "onanimationcancel",
375 376 377
                "onanimationend",
                "onanimationiteration",
                "onanimationstart",
378
                "onauxclick",
379 380 381 382 383 384 385
                "onbeforeprint",
                "onbeforeunload",
                "onblur",
                "oncanplay",
                "oncanplaythrough",
                "onchange",
                "onclick",
386
                "onclose",
387
                "oncontextmenu",
388
                "oncuechange",
389 390 391 392 393 394 395 396
                "ondblclick",
                "ondevicelight",
                "ondevicemotion",
                "ondeviceorientation",
                "ondeviceproximity",
                "ondrag",
                "ondragend",
                "ondragenter",
397
                "ondragexit",
398 399 400 401 402 403 404 405 406
                "ondragleave",
                "ondragover",
                "ondragstart",
                "ondrop",
                "ondurationchange",
                "onemptied",
                "onended",
                "onerror",
                "onfocus",
407
                "onformdata",
408 409 410 411 412 413 414 415 416 417
                "onhashchange",
                "oninput",
                "oninvalid",
                "onkeydown",
                "onkeypress",
                "onkeyup",
                "onlanguagechange",
                "onload",
                "onloadeddata",
                "onloadedmetadata",
418
                "onloadend",
419 420
                "onloadstart",
                "onmessage",
421
                "onmessageerror",
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
                "onmousedown",
                "onmouseenter",
                "onmouseleave",
                "onmousemove",
                "onmouseout",
                "onmouseover",
                "onmouseup",
                "onmozfullscreenchange",
                "onmozfullscreenerror",
                "onoffline",
                "ononline",
                "onpagehide",
                "onpageshow",
                "onpause",
                "onplay",
                "onplaying",
                "onpopstate",
                "onprogress",
                "onratechange",
441
                "onrejectionhandled",
442 443 444 445 446 447
                "onreset",
                "onresize",
                "onscroll",
                "onseeked",
                "onseeking",
                "onselect",
448
                "onselectstart",
449 450
                "onshow",
                "onstalled",
451
                "onstorage",
452 453 454
                "onsubmit",
                "onsuspend",
                "ontimeupdate",
455
                "ontoggle",
456
                "ontransitioncancel",
457
                "ontransitionend",
458 459
                "ontransitionrun",
                "ontransitionstart",
460
                "onunhandledrejection",
461 462 463 464
                "onunload",
                "onuserproximity",
                "onvolumechange",
                "onwaiting",
465 466 467 468
                "onwebkitanimationend",
                "onwebkitanimationiteration",
                "onwebkitanimationstart",
                "onwebkittransitionend",
469 470 471 472
                "onwheel",
                "open",
                "opener",
                "Option",
473
                "origin",
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
                "outerHeight",
                "outerWidth",
                "PageTransitionEvent",
                "pageXOffset",
                "pageYOffset",
                "PaintRequest",
                "PaintRequestList",
                "parent",
                "parseFloat",
                "parseInt",
                "Path2D",
                "performance",
                "Performance",
                "PerformanceEntry",
                "PerformanceMark",
                "PerformanceMeasure",
                "PerformanceNavigation",
491 492
                "PerformanceObserver",
                "PerformanceObserverEntryList",
493
                "PerformanceResourceTiming",
494
                "PerformanceServerTiming",
495
                "PerformanceTiming",
496 497
                "Permissions",
                "PermissionStatus",
498 499 500 501 502 503 504 505 506 507
                "personalbar",
                "Plugin",
                "PluginArray",
                "PopStateEvent",
                "PopupBlockedEvent",
                "postMessage",
                "print",
                "ProcessingInstruction",
                "ProgressEvent",
                "Promise",
508
                "PromiseRejectionEvent",
509
                "prompt",
510 511
                "propertyIsEnumerable",
                "__proto__",
512
                "Proxy",
513
                "queueMicrotask",
514 515 516
                "RadioNodeList",
                "Range",
                "RangeError",
517
                "ReadableStream",
518
                "ReferenceError",
519
                "Reflect",
520 521 522
                "RegExp",
                "releaseEvents",
                "removeEventListener",
523
                "Request",
524
                "requestAnimationFrame",
525
                "requestIdleCallback",
526
                "resizeBy",
527 528 529
                "ResizeObserver",
                "ResizeObserverEntry",
                "ResizeObserverSize",
530
                "resizeTo",
531
                "Response",
532 533
                "screen",
                "Screen",
534
                "screenLeft",
535
                "ScreenOrientation",
536
                "screenTop",
537 538 539 540 541 542 543 544 545 546 547 548 549
                "screenX",
                "screenY",
                "scroll",
                "ScrollAreaEvent",
                "scrollbars",
                "scrollBy",
                "scrollByLines",
                "scrollByPages",
                "scrollMaxX",
                "scrollMaxY",
                "scrollTo",
                "scrollX",
                "scrollY",
550
                "SecurityPolicyViolationEvent",
551 552 553 554 555 556 557
                "Selection",
                "self",
                "sessionStorage",
                "Set",
                "setInterval",
                "setResizable",
                "setTimeout",
558
                "ShadowRoot",
559 560 561
                "SharedWorker",
                "sidebar",
                "sizeToContent",
562 563
                "SourceBuffer",
                "SourceBufferList",
564
                "speechSynthesis",
565 566
                "SpeechSynthesis",
                "SpeechSynthesisErrorEvent",
567
                "SpeechSynthesisEvent",
568 569 570
                "SpeechSynthesisUtterance",
                "SpeechSynthesisVoice",
                "StaticRange",
571 572 573 574 575 576 577 578 579
                "status",
                "statusbar",
                "stop",
                "Storage",
                "StorageEvent",
                "StorageManager",
                "String",
                "StyleSheet",
                "StyleSheetList",
580
                "SubmitEvent",
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
                "SubtleCrypto",
                "SVGAElement",
                "SVGAngle",
                "SVGAnimatedAngle",
                "SVGAnimatedBoolean",
                "SVGAnimatedEnumeration",
                "SVGAnimatedInteger",
                "SVGAnimatedLength",
                "SVGAnimatedLengthList",
                "SVGAnimatedNumber",
                "SVGAnimatedNumberList",
                "SVGAnimatedPreserveAspectRatio",
                "SVGAnimatedRect",
                "SVGAnimatedString",
                "SVGAnimatedTransformList",
                "SVGAnimateElement",
                "SVGAnimateMotionElement",
                "SVGAnimateTransformElement",
                "SVGAnimationElement",
                "SVGCircleElement",
                "SVGClipPathElement",
                "SVGComponentTransferFunctionElement",
                "SVGDefsElement",
                "SVGDescElement",
                "SVGElement",
                "SVGEllipseElement",
                "SVGFEBlendElement",
                "SVGFEColorMatrixElement",
                "SVGFEComponentTransferElement",
                "SVGFECompositeElement",
                "SVGFEConvolveMatrixElement",
                "SVGFEDiffuseLightingElement",
                "SVGFEDisplacementMapElement",
                "SVGFEDistantLightElement",
                "SVGFEDropShadowElement",
                "SVGFEFloodElement",
                "SVGFEFuncAElement",
                "SVGFEFuncBElement",
                "SVGFEFuncGElement",
                "SVGFEFuncRElement",
                "SVGFEGaussianBlurElement",
                "SVGFEImageElement",
                "SVGFEMergeElement",
                "SVGFEMergeNodeElement",
                "SVGFEMorphologyElement",
                "SVGFEOffsetElement",
                "SVGFEPointLightElement",
                "SVGFESpecularLightingElement",
                "SVGFESpotLightElement",
                "SVGFETileElement",
                "SVGFETurbulenceElement",
                "SVGFilterElement",
                "SVGForeignObjectElement",
                "SVGGElement",
635
                "SVGGeometryElement",
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686
                "SVGGradientElement",
                "SVGGraphicsElement",
                "SVGImageElement",
                "SVGLength",
                "SVGLengthList",
                "SVGLinearGradientElement",
                "SVGLineElement",
                "SVGMarkerElement",
                "SVGMaskElement",
                "SVGMatrix",
                "SVGMetadataElement",
                "SVGMPathElement",
                "SVGNumber",
                "SVGNumberList",
                "SVGPathElement",
                "SVGPathSegList",
                "SVGPatternElement",
                "SVGPoint",
                "SVGPointList",
                "SVGPolygonElement",
                "SVGPolylineElement",
                "SVGPreserveAspectRatio",
                "SVGRadialGradientElement",
                "SVGRect",
                "SVGRectElement",
                "SVGScriptElement",
                "SVGSetElement",
                "SVGStopElement",
                "SVGStringList",
                "SVGStyleElement",
                "SVGSVGElement",
                "SVGSwitchElement",
                "SVGSymbolElement",
                "SVGTextContentElement",
                "SVGTextElement",
                "SVGTextPathElement",
                "SVGTextPositioningElement",
                "SVGTitleElement",
                "SVGTransform",
                "SVGTransformList",
                "SVGTSpanElement",
                "SVGUnitTypes",
                "SVGUseElement",
                "SVGViewElement",
                "Symbol",
                "SyntaxError",
                "Text",
                "TextDecoder",
                "TextEncoder",
                "TextMetrics",
                "TextTrack",
687
                "TextTrackCue",
688 689 690 691
                "TextTrackCueList",
                "TextTrackList",
                "TimeEvent",
                "TimeRanges",
692
                "toLocaleString",
693 694
                "toolbar",
                "top",
695
                "toString",
696 697 698 699
                "TrackEvent",
                "TransitionEvent",
                "TreeWalker",
                "TypeError",
700 701
                "u2f",
                "U2F",
702 703 704 705 706 707 708 709 710 711 712 713
                "UIEvent",
                "Uint16Array",
                "Uint32Array",
                "Uint8Array",
                "Uint8ClampedArray",
                "undefined",
                "unescape",
                "updateCommands",
                "URIError",
                "URL",
                "URLSearchParams",
                "ValidityState",
714
                "valueOf",
715
                "VideoPlaybackQuality",
716
                "VisualViewport",
717
                "VTTCue",
718
                "VTTRegion",
719 720
                "WeakMap",
                "WeakSet",
721
                "WebAssembly",
722 723
                "WebGLActiveInfo",
                "WebGLBuffer",
724
                "WebGLContextEvent",
725 726
                "WebGLFramebuffer",
                "WebGLProgram",
727
                "WebGLQuery",
728 729 730 731 732 733
                "WebGLRenderbuffer",
                "WebGLRenderingContext",
                "WebGLShader",
                "WebGLShaderPrecisionFormat",
                "WebGLTexture",
                "WebGLUniformLocation",
734 735
                "WebGLVertexArrayObject",
                "WebKitCSSMatrix",
736
                "webkitURL",
737 738 739 740 741
                "WebSocket",
                "WheelEvent",
                "window",
                "Window",
                "Worker",
742
                "Worklet",
743 744 745 746 747 748 749 750 751 752
                "XMLDocument",
                "XMLHttpRequest",
                "XMLHttpRequestEventTarget",
                "XMLHttpRequestUpload",
                "XMLSerializer",
                "XPathEvaluator",
                "XPathExpression",
                "XPathResult",
                "XSLTProcessor",
                ]
753 754 755
        self.expectedObjects80 = self.expectedObjects + ["AggregateError", "FinalizationRegistry", "WeakRef"]
        self.expectedObjects80.remove("content")
        self.expectedObjects80.sort()
756 757

    def test_dom_objects_enumeration(self):
758 759 760 761
        expectedObjects = self.expectedObjects
        if self.get_version() >= 80:
            expectedObjects = self.expectedObjects80

762
        with self.marionette.using_context('content'):
763 764 765 766
            self.marionette.navigate(self.test_page_file_url)
            self.marionette.timeout.implicit = 5
            elt = self.marionette.find_element('id', 'enumeration')
            r = elt.text.split("\n")
767 768 769
            err = False
            unknown_objects = ''
            for l in r:
770
                if l in expectedObjects:
771 772 773 774 775 776 777
                    continue
                err = True
                unknown_objects += l + "\n"

            err_msg = "Unknown objects:\n%s" % unknown_objects
            self.assertFalse(err, msg=err_msg)

778
            for l in expectedObjects:
779 780 781 782 783 784 785 786
                if l in r:
                    continue
                err = True
                unknown_objects += l + "\n"

            err_msg = "Expected objects not found:\n%s" % unknown_objects
            self.assertFalse(err, msg=err_msg)