예제 #1
0
    def _init_downloadmanager(self):
        log.init.debug("Initializing downloads...")
        qtnetwork_download_manager = objreg.get('qtnetwork-download-manager')

        try:
            webengine_download_manager = objreg.get(
                'webengine-download-manager')
        except KeyError:
            webengine_download_manager = None

        download_model = downloads.DownloadModel(qtnetwork_download_manager,
                                                 webengine_download_manager)
        objreg.register('download-model', download_model, scope='window',
                        window=self.win_id)
예제 #2
0
def test_download_model(qapp, qtmodeltester, manager):
    """Simple check for download model internals."""
    model = downloads.DownloadModel(manager)
    qtmodeltester.check(model)
예제 #3
0
def test_download_model(qapp, qtmodeltester, config_stub, cookiejar_and_cache,
                        fake_args):
    """Simple check for download model internals."""
    manager = qtnetworkdownloads.DownloadManager()
    model = downloads.DownloadModel(manager)
    qtmodeltester.check(model)
예제 #4
0
def test_download_model(qapp, qtmodeltester, config_stub, cookiejar_and_cache):
    """Simple check for download model internals."""
    config_stub.data = {'general': {'private-browsing': False}}
    manager = qtnetworkdownloads.DownloadManager(win_id=0)
    model = downloads.DownloadModel(manager)
    qtmodeltester.check(model)
예제 #5
0
def model(qtnetwork_manager, qtmodeltester, qapp):
    """A simple DownloadModel."""
    model = downloads.DownloadModel(qtnetwork_manager)
    qtmodeltester.check(model)
    return model