Esempio n. 1
0
 def test_setting_private_mode_later(self, config_stub):
     config_stub.data = {'general': {'private-browsing': False}}
     nam = networkmanager.NetworkManager(0, 0)
     assert not isinstance(nam.cookieJar(), cookies.RAMCookieJar)
     config_stub.data = {'general': {'private-browsing': True}}
     nam.on_config_changed()
     assert isinstance(nam.cookieJar(), cookies.RAMCookieJar)
Esempio n. 2
0
 def __init__(self, win_id, tab_id, parent=None):
     super().__init__(parent)
     self._win_id = win_id
     self._is_shutting_down = False
     self._extension_handlers = {
         QWebPage.ErrorPageExtension: self._handle_errorpage,
         QWebPage.ChooseMultipleFilesExtension: self._handle_multiple_files,
     }
     self._ignore_load_started = False
     self.error_occurred = False
     self.open_target = usertypes.ClickTarget.normal
     self._hint_target = None
     self._networkmanager = networkmanager.NetworkManager(
         win_id, tab_id, self)
     self.setNetworkAccessManager(self._networkmanager)
     self.setForwardUnsupportedContent(True)
     self.reloading.connect(self._networkmanager.clear_rejected_ssl_errors)
     self.printRequested.connect(self.on_print_requested)
     self.downloadRequested.connect(self.on_download_requested)
     self.unsupportedContent.connect(self.on_unsupported_content)
     self.loadStarted.connect(self.on_load_started)
     self.featurePermissionRequested.connect(
         self.on_feature_permission_requested)
     self.saveFrameStateRequested.connect(
         self.on_save_frame_state_requested)
     self.restoreFrameStateRequested.connect(
         self.on_restore_frame_state_requested)
Esempio n. 3
0
 def __init__(self, win_id, parent=None):
     super().__init__(parent)
     self._win_id = win_id
     self.downloads = []
     self.questions = []
     self._networkmanager = networkmanager.NetworkManager(
         win_id, None, self)
Esempio n. 4
0
 def __init__(self, win_id, parent=None):
     super().__init__(parent)
     self._win_id = win_id
     self.downloads = []
     self.questions = []
     self._networkmanager = networkmanager.NetworkManager(
         win_id, None, self)
     self._update_timer = usertypes.Timer(self, 'download-update')
     self._update_timer.timeout.connect(self.update_gui)
     self._update_timer.setInterval(REFRESH_INTERVAL)
Esempio n. 5
0
 def __init__(self, win_id, parent=None):
     super().__init__(parent)
     self._win_id = win_id
     self._extension_handlers = {
         QWebPage.ErrorPageExtension: self._handle_errorpage,
         QWebPage.ChooseMultipleFilesExtension: self._handle_multiple_files,
     }
     self._ignore_load_started = False
     self.error_occured = False
     self._networkmanager = networkmanager.NetworkManager(win_id, self)
     self.setNetworkAccessManager(self._networkmanager)
     self.setForwardUnsupportedContent(True)
     self.printRequested.connect(self.on_print_requested)
     self.downloadRequested.connect(self.on_download_requested)
     self.unsupportedContent.connect(self.on_unsupported_content)
     self.loadStarted.connect(self.on_load_started)
Esempio n. 6
0
 def test_init_with_private_mode(self, config_stub):
     config_stub.data = {'general': {'private-browsing': True}}
     nam = networkmanager.NetworkManager(0, 0)
     assert isinstance(nam.cookieJar(), cookies.RAMCookieJar)