SEBWIN-219: Cleaned up remaining TODOs.

This commit is contained in:
dbuechel 2018-02-28 09:45:29 +01:00
parent 8a06a0fe98
commit f5ef7fa859
13 changed files with 37 additions and 25 deletions

View file

@ -45,7 +45,9 @@ namespace SafeExamBrowser.Browser
var cefSettings = new CefSettings
{
CachePath = runtimeInfo.BrowserCachePath,
LogFile = runtimeInfo.BrowserLogFile
LogFile = runtimeInfo.BrowserLogFile,
// TODO: Set according to current application LogLevel!
LogSeverity = LogSeverity.Verbose
};
var success = Cef.Initialize(cefSettings, true, null);

View file

@ -9,6 +9,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using SafeExamBrowser.Client.Behaviour.Operations;
using SafeExamBrowser.Contracts.Behaviour;
using SafeExamBrowser.Contracts.Configuration;
using SafeExamBrowser.Contracts.Configuration.Settings;
using SafeExamBrowser.Contracts.I18n;
@ -24,6 +25,8 @@ namespace SafeExamBrowser.Client.UnitTests.Behaviour.Operations
{
private Mock<ILogger> loggerMock;
private TaskbarSettings settings;
private Mock<INotificationInfo> logInfoMock;
private Mock<INotificationController> logControllerMock;
private Mock<ISystemComponent<ISystemKeyboardLayoutControl>> keyboardLayoutMock;
private Mock<ISystemComponent<ISystemPowerSupplyControl>> powerSupplyMock;
private Mock<ISystemComponent<ISystemWirelessNetworkControl>> wirelessNetworkMock;
@ -38,12 +41,14 @@ namespace SafeExamBrowser.Client.UnitTests.Behaviour.Operations
public void Initialize()
{
loggerMock = new Mock<ILogger>();
settings = new TaskbarSettings();
logInfoMock = new Mock<INotificationInfo>();
logControllerMock = new Mock<INotificationController>();
keyboardLayoutMock = new Mock<ISystemComponent<ISystemKeyboardLayoutControl>>();
powerSupplyMock = new Mock<ISystemComponent<ISystemPowerSupplyControl>>();
wirelessNetworkMock = new Mock<ISystemComponent<ISystemWirelessNetworkControl>>();
systemInfoMock = new Mock<ISystemInfo>();
taskbarMock = new Mock<ITaskbar>();
settings = new TaskbarSettings();
textMock = new Mock<IText>();
uiFactoryMock = new Mock<IUserInterfaceFactory>();
@ -55,12 +60,14 @@ namespace SafeExamBrowser.Client.UnitTests.Behaviour.Operations
sut = new TaskbarOperation(
loggerMock.Object,
settings,
logInfoMock.Object,
logControllerMock.Object,
keyboardLayoutMock.Object,
powerSupplyMock.Object,
wirelessNetworkMock.Object,
systemInfoMock.Object,
taskbarMock.Object,
settings,
textMock.Object,
uiFactoryMock.Object);
}

View file

@ -38,7 +38,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations
ProgressIndicator?.UpdateText(TextKey.ProgressIndicator_InitializeProcessMonitoring);
// TODO
// TODO: Implement process monitoring...
}
public void Repeat()
@ -51,7 +51,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations
logger.Info("Stopping process monitoring...");
ProgressIndicator?.UpdateText(TextKey.ProgressIndicator_StopProcessMonitoring);
// TODO
// TODO: Implement process monitoring...
ProgressIndicator?.UpdateText(TextKey.ProgressIndicator_WaitExplorerStartup, true);

View file

@ -6,7 +6,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using SafeExamBrowser.Client.Notifications;
using SafeExamBrowser.Contracts.Behaviour;
using SafeExamBrowser.Contracts.Behaviour.Operations;
using SafeExamBrowser.Contracts.Configuration;
@ -22,6 +21,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations
internal class TaskbarOperation : IOperation
{
private ILogger logger;
private INotificationInfo logInfo;
private INotificationController logController;
private TaskbarSettings settings;
private ISystemComponent<ISystemKeyboardLayoutControl> keyboardLayout;
@ -37,19 +37,23 @@ namespace SafeExamBrowser.Client.Behaviour.Operations
public TaskbarOperation(
ILogger logger,
TaskbarSettings settings,
INotificationInfo logInfo,
INotificationController logController,
ISystemComponent<ISystemKeyboardLayoutControl> keyboardLayout,
ISystemComponent<ISystemPowerSupplyControl> powerSupply,
ISystemComponent<ISystemWirelessNetworkControl> wirelessNetwork,
ISystemInfo systemInfo,
ITaskbar taskbar,
TaskbarSettings settings,
IText text,
IUserInterfaceFactory uiFactory)
{
this.logger = logger;
this.settings = settings;
this.logInfo = logInfo;
this.logController = logController;
this.keyboardLayout = keyboardLayout;
this.powerSupply = powerSupply;
this.settings = settings;
this.systemInfo = systemInfo;
this.taskbar = taskbar;
this.text = text;
@ -95,7 +99,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations
if (settings.AllowApplicationLog)
{
logController?.Terminate();
logController.Terminate();
}
if (settings.AllowKeyboardLayout)
@ -140,13 +144,9 @@ namespace SafeExamBrowser.Client.Behaviour.Operations
private void CreateLogNotification()
{
// TODO: Resolve dependencies -> CompositionRoot!
var logInfo = new LogNotificationInfo(text);
var logNotification = uiFactory.CreateNotification(logInfo);
logController = new LogNotificationController(logger, uiFactory);
logController.RegisterNotification(logNotification);
taskbar.AddNotification(logNotification);
}
}

View file

@ -13,6 +13,7 @@ using SafeExamBrowser.Browser;
using SafeExamBrowser.Client.Behaviour;
using SafeExamBrowser.Client.Behaviour.Operations;
using SafeExamBrowser.Client.Communication;
using SafeExamBrowser.Client.Notifications;
using SafeExamBrowser.Configuration;
using SafeExamBrowser.Contracts.Behaviour;
using SafeExamBrowser.Contracts.Behaviour.Operations;
@ -180,9 +181,11 @@ namespace SafeExamBrowser.Client
private IOperation BuildTaskbarOperation()
{
var keyboardLayout = new KeyboardLayout(new ModuleLogger(logger, typeof(KeyboardLayout)), text);
var logController = new LogNotificationController(logger, uiFactory);
var logInfo = new LogNotificationInfo(text);
var powerSupply = new PowerSupply(new ModuleLogger(logger, typeof(PowerSupply)), text);
var wirelessNetwork = new WirelessNetwork(new ModuleLogger(logger, typeof(WirelessNetwork)), text);
var operation = new TaskbarOperation(logger, configuration.Settings.Taskbar, keyboardLayout, powerSupply, wirelessNetwork, systemInfo, Taskbar, text, uiFactory);
var operation = new TaskbarOperation(logger, logInfo, logController, keyboardLayout, powerSupply, wirelessNetwork, systemInfo, Taskbar, configuration.Settings.Taskbar, text, uiFactory);
return operation;
}

View file

@ -59,7 +59,7 @@ namespace SafeExamBrowser.Configuration
public Settings LoadSettings(Uri path)
{
// TODO
// TODO: Implement loading mechanism
return LoadDefaultSettings();
}
@ -68,7 +68,7 @@ namespace SafeExamBrowser.Configuration
{
var settings = new Settings()
{
// TODO
// TODO: Implement default settings
ServicePolicy = ServicePolicy.Optional
};

View file

@ -13,7 +13,6 @@ using SafeExamBrowser.Contracts.Configuration.Settings;
namespace SafeExamBrowser.Contracts.Behaviour
{
// TODO: Interface really needed?!
public interface IClientController
{
/// <summary>

View file

@ -8,7 +8,6 @@
namespace SafeExamBrowser.Contracts.Behaviour
{
// TODO: Interface really needed?!
public interface IRuntimeController
{
/// <summary>

View file

@ -48,7 +48,8 @@ namespace SafeExamBrowser.Core.Communication
return;
}
// TODO: Send(new StartSessionMessage { Id = sessionId, Settings = settings });
// TODO: Implement service communication
// Send(new StartSessionMessage { Id = sessionId, Settings = settings });
}
public void StopSession(Guid sessionId)
@ -58,7 +59,8 @@ namespace SafeExamBrowser.Core.Communication
return;
}
// TODO: Send(new StopSessionMessage { SessionId = sessionId });
// TODO: Implement service communication
// Send(new StopSessionMessage { SessionId = sessionId });
}
private bool IgnoreOperation(string operationName)

View file

@ -50,7 +50,7 @@ namespace SafeExamBrowser.Runtime.Behaviour.Operations
public void Repeat()
{
// TODO
// TODO: Depends on new kiosk mode!
}
public void Revert()

View file

@ -65,7 +65,7 @@ namespace SafeExamBrowser.Runtime.Behaviour.Operations
public void Repeat()
{
// TODO
// TODO: Re-check if mandatory, if so, try to connect (if not connected) - otherwise, no action required (except maybe logging of status?)
}
public void Revert()

View file

@ -15,7 +15,7 @@ namespace SafeExamBrowser.WindowsApi
{
private ILogger logger;
// TODO!
// TODO: Implement desktop functionality!
public string CurrentName => "Default";
public Desktop(ILogger logger)

View file

@ -34,7 +34,7 @@ namespace SafeExamBrowser.WindowsApi
var startupInfo = new STARTUPINFO();
startupInfo.cb = Marshal.SizeOf(startupInfo);
// TODO:
// TODO: Specify target desktop!
//startupInfo.lpDesktop = desktop.CurrentName;
var success = Kernel32.CreateProcess(null, commandLine, IntPtr.Zero, IntPtr.Zero, true, Constant.NORMAL_PRIORITY_CLASS, IntPtr.Zero, null, ref startupInfo, ref processInfo);