# Path: wdom/document.py
# def get_document() -> Document:
#     """Get current root document object.
# 
#     :rtype: Document
#     """
#     return rootDocument
# 
# Path: wdom/server/_tornado.py
# def is_connected() -> bool:
#     def get(self) -> None:
#     def open(self) -> None:
#     def on_message(self, message: str) -> None:
#     async def terminate(self) -> None:
#     def on_close(self) -> None:
#     def set_extra_headers(self, path: str) -> None:
#     def __init__(self, *args: Any, **kwargs: Any) -> None:
#     def log_request(self, handler: web.RequestHandler) -> None:
#     def add_static_path(self, prefix: str, path: str) -> None:
#     def add_favicon_path(self, path: str) -> None:
# def get_app(*args: Any, **kwargs: Any) -> Application:
# def set_application(app: Application) -> None:
# def start_server(app: web.Application = None, port: int = None,
#                  address: str = None, **kwargs: Any) -> HTTPServer:
# def stop_server(server: HTTPServer) -> None:
# class MainHandler(web.RequestHandler):
# class WSHandler(websocket.WebSocketHandler):
# class StaticFileHandlerNoCache(web.StaticFileHandler):
# class Application(web.Application):
# 
# Path: wdom/server/handler.py
# def event_handler(msg: EventMsgDict) -> Event:
#     """Handle events emitted on browser."""
#     e = create_event_from_msg(msg)
#     if e.currentTarget is None:
#         if e.type not in ['mount', 'unmount']:
#             id = msg['currentTarget']['id']
#             logger.warning('No such element: wdom_id={}'.format(id))
#         return e
#     e.currentTarget.on_event_pre(e)
#     e.currentTarget.dispatchEvent(e)
#     return e
# 
# Path: wdom/window.py
# @property
# def customElements(self) -> CustomElementsRegistry:
#     """Return customElementsRegistry object."""
#     return self._custom_elements
# 
# Path: tests/base.py
# class TestCase(unittest.TestCase):
#     """Base class for testing wdom modules.
# 
#     This class is a sub class of the ``unittest.TestCase``. After all test
#     methods, reset wdom's global objects like document, application, and
#     elements. If you use ``tearDown`` method, do not forget to call
#     ``super().tearDown()``.
#     """
# 
#     def setUp(self) -> None:
#         """Reset WDOM states."""
#         super().setUp()
#         reset()
# 
#     def tearDown(self) -> None:
#         """Reset WDOM states."""
#         reset()
#         super().tearDown()
# 
#     def assertIsTrue(self, bl: bool) -> None:
#         """Check arg is exactly True, not truthy."""
#         self.assertIs(bl, True)
# 
#     def assertIsFalse(self, bl: bool) -> None:
#         """Check arg is exactly False, not falsy."""
#         self.assertIs(bl, False)


from time import sleep
from unittest.mock import MagicMock
from wdom.document import get_document
from wdom.server import _tornado
from wdom.server.handler import event_handler
from wdom.window import customElements
from .base import TestCase
#!/usr/bin/env python3
# -*- coding: utf-8 -*-





class TestWindow(TestCase):
    def setUp(self):
        super().setUp()
        self.doc = get_document()
        self.win = self.doc.defaultView
        self.conn_mock = MagicMock()
        _tornado.connections.append(self.conn_mock)

    def tearDown(self):
        _tornado.connections.remove(self.conn_mock)

    def test_custom_elements_registory(self):

# Path: wdom/document.py
# def get_document() -> Document:
#     """Get current root document object.
# 
#     :rtype: Document
#     """
#     return rootDocument
# 
# Path: wdom/server/_tornado.py
# def is_connected() -> bool:
#     def get(self) -> None:
#     def open(self) -> None:
#     def on_message(self, message: str) -> None:
#     async def terminate(self) -> None:
#     def on_close(self) -> None:
#     def set_extra_headers(self, path: str) -> None:
#     def __init__(self, *args: Any, **kwargs: Any) -> None:
#     def log_request(self, handler: web.RequestHandler) -> None:
#     def add_static_path(self, prefix: str, path: str) -> None:
#     def add_favicon_path(self, path: str) -> None:
# def get_app(*args: Any, **kwargs: Any) -> Application:
# def set_application(app: Application) -> None:
# def start_server(app: web.Application = None, port: int = None,
#                  address: str = None, **kwargs: Any) -> HTTPServer:
# def stop_server(server: HTTPServer) -> None:
# class MainHandler(web.RequestHandler):
# class WSHandler(websocket.WebSocketHandler):
# class StaticFileHandlerNoCache(web.StaticFileHandler):
# class Application(web.Application):
# 
# Path: wdom/server/handler.py
# def event_handler(msg: EventMsgDict) -> Event:
#     """Handle events emitted on browser."""
#     e = create_event_from_msg(msg)
#     if e.currentTarget is None:
#         if e.type not in ['mount', 'unmount']:
#             id = msg['currentTarget']['id']
#             logger.warning('No such element: wdom_id={}'.format(id))
#         return e
#     e.currentTarget.on_event_pre(e)
#     e.currentTarget.dispatchEvent(e)
#     return e
# 
# Path: wdom/window.py
# @property
# def customElements(self) -> CustomElementsRegistry:
#     """Return customElementsRegistry object."""
#     return self._custom_elements
# 
# Path: tests/base.py
# class TestCase(unittest.TestCase):
#     """Base class for testing wdom modules.
# 
#     This class is a sub class of the ``unittest.TestCase``. After all test
#     methods, reset wdom's global objects like document, application, and
#     elements. If you use ``tearDown`` method, do not forget to call
#     ``super().tearDown()``.
#     """
# 
#     def setUp(self) -> None:
#         """Reset WDOM states."""
#         super().setUp()
#         reset()
# 
#     def tearDown(self) -> None:
#         """Reset WDOM states."""
#         reset()
#         super().tearDown()
# 
#     def assertIsTrue(self, bl: bool) -> None:
#         """Check arg is exactly True, not truthy."""
#         self.assertIs(bl, True)
# 
#     def assertIsFalse(self, bl: bool) -> None:
#         """Check arg is exactly False, not falsy."""
#         self.assertIs(bl, False)


# Path: tests/test_window.py
from time import sleep
from unittest.mock import MagicMock
from wdom.document import get_document
from wdom.server import _tornado
from wdom.server.handler import event_handler
from wdom.window import customElements
from .base import TestCase

#!/usr/bin/env python3
# -*- coding: utf-8 -*-





class TestWindow(TestCase):
    def setUp(self):
        super().setUp()
        self.doc = get_document()
        self.win = self.doc.defaultView
        self.conn_mock = MagicMock()
        _tornado.connections.append(self.conn_mock)

    def tearDown(self):
        _tornado.connections.remove(self.conn_mock)

    def test_custom_elements_registory(self):

        self.assertIs(self.win.customElements, customElements)