internal TestableRequestHandler( AppConfig appConfig, IRequestFilter filter, ILogger logger, BrowserSettings settings, ResourceHandler resourceHandler, IText text) : base(appConfig, filter, logger, settings, resourceHandler, text) { }
public void Initialize() { appConfig = new AppConfig(); filter = new Mock <IRequestFilter>(); logger = new Mock <ILogger>(); settings = new BrowserSettings(); text = new Mock <IText>(); resourceHandler = new ResourceHandler(appConfig, settings, filter.Object, logger.Object, text.Object); sut = new TestableRequestHandler(appConfig, filter.Object, logger.Object, settings, resourceHandler, text.Object); }
private void InitializeControl() { var contextMenuHandler = new ContextMenuHandler(); var dialogHandler = new DialogHandler(); var displayHandler = new DisplayHandler(); var downloadLogger = logger.CloneFor($"{nameof(DownloadHandler)} #{Id}"); var downloadHandler = new DownloadHandler(appConfig, downloadLogger, settings, WindowSettings); var keyboardHandler = new KeyboardHandler(); var lifeSpanHandler = new LifeSpanHandler(); var requestFilter = new RequestFilter(); var requestLogger = logger.CloneFor($"{nameof(RequestHandler)} #{Id}"); var resourceHandler = new ResourceHandler(appConfig, requestFilter, logger, settings, WindowSettings, text); var requestHandler = new RequestHandler(appConfig, requestFilter, requestLogger, resourceHandler, settings, WindowSettings, text); Icon = new BrowserIconResource(); dialogHandler.DialogRequested += DialogHandler_DialogRequested; displayHandler.FaviconChanged += DisplayHandler_FaviconChanged; displayHandler.ProgressChanged += DisplayHandler_ProgressChanged; downloadHandler.ConfigurationDownloadRequested += DownloadHandler_ConfigurationDownloadRequested; downloadHandler.DownloadUpdated += DownloadHandler_DownloadUpdated; keyboardHandler.FindRequested += KeyboardHandler_FindRequested; keyboardHandler.HomeNavigationRequested += HomeNavigationRequested; keyboardHandler.ReloadRequested += ReloadRequested; keyboardHandler.ZoomInRequested += ZoomInRequested; keyboardHandler.ZoomOutRequested += ZoomOutRequested; keyboardHandler.ZoomResetRequested += ZoomResetRequested; lifeSpanHandler.PopupRequested += LifeSpanHandler_PopupRequested; resourceHandler.SessionIdentifierDetected += (id) => SessionIdentifierDetected?.Invoke(id); requestHandler.QuitUrlVisited += RequestHandler_QuitUrlVisited; requestHandler.RequestBlocked += RequestHandler_RequestBlocked; InitializeRequestFilter(requestFilter); control = new BrowserControl( contextMenuHandler, dialogHandler, displayHandler, downloadHandler, keyboardHandler, lifeSpanHandler, requestHandler, startUrl); control.AddressChanged += Control_AddressChanged; control.LoadFailed += Control_LoadFailed; control.LoadingStateChanged += Control_LoadingStateChanged; control.TitleChanged += Control_TitleChanged; control.Initialize(); logger.Debug("Initialized browser control."); }