示例#1
0
    def __init__(self, browser_backend, context, timeout=60):
        super(InspectorBackend, self).__init__(self._HandleNotification,
                                               self._HandleError)

        self._browser_backend = browser_backend
        self._context = context
        self._domain_handlers = {}

        logging.debug('InspectorBackend._Connect() to %s', self.debugger_url)
        try:
            self.Connect(self.debugger_url)
        except (websocket.WebSocketException, util.TimeoutException):
            err_msg = sys.exc_info()[1]
            if not self._browser_backend.IsBrowserRunning():
                raise exceptions.BrowserGoneException(self.browser, err_msg)
            elif not self._browser_backend.HasBrowserFinishedLaunching():
                raise exceptions.BrowserConnectionGoneException(
                    self.browser, err_msg)
            else:
                raise exceptions.TabCrashException(self.browser, err_msg)

        self._console = inspector_console.InspectorConsole(self)
        self._memory = inspector_memory.InspectorMemory(self)
        self._page = inspector_page.InspectorPage(self, timeout=timeout)
        self._runtime = inspector_runtime.InspectorRuntime(self)
        self._timeline = inspector_timeline.InspectorTimeline(self)
        self._network = inspector_network.InspectorNetwork(self)
        self._timeline_model = None
示例#2
0
    def __init__(self, browser, browser_backend, debugger_url):
        assert debugger_url
        self._browser = browser
        self._browser_backend = browser_backend
        self._debugger_url = debugger_url
        self._socket = None
        self._domain_handlers = {}
        self._cur_socket_timeout = 0
        self._next_request_id = 0

        self._console = inspector_console.InspectorConsole(self)
        self._memory = inspector_memory.InspectorMemory(self)
        self._page = inspector_page.InspectorPage(self)
        self._runtime = inspector_runtime.InspectorRuntime(self)
        self._timeline = inspector_timeline.InspectorTimeline(self)
        self._network = inspector_network.InspectorNetwork(self)
示例#3
0
    def __init__(self, browser_backend, context, timeout=60):
        self._browser_backend = browser_backend
        self._context = context
        self._socket = None
        self._domain_handlers = {}
        self._cur_socket_timeout = 0
        self._next_request_id = 0

        self._Connect()

        self._console = inspector_console.InspectorConsole(self)
        self._memory = inspector_memory.InspectorMemory(self)
        self._page = inspector_page.InspectorPage(self, timeout=timeout)
        self._runtime = inspector_runtime.InspectorRuntime(self)
        self._timeline = inspector_timeline.InspectorTimeline(self)
        self._network = inspector_network.InspectorNetwork(self)
        self._timeline_model = None