public void TestTwoProtocolHandlers() { var filename = new Holder<string>(); using (var protocolHandler1 = new FileProtocolHandler(Context, "pone", FilenameProtocolHandler, (fn) => "text/html")) using (var protocolHandler2 = new FileProtocolHandler(Context, "ptwo", FilenameProtocolHandler, (fn) => "text/html")) using (var window = new Window(Context)) { window.ChromeSend += (w, msg, args) => { if (msg == "filename") filename.Value = args[0]; }; window.NavigateTo("pone://test/one.html"); WaitFor(filename, "test/one.html", 5); window.NavigateTo("ptwo://test/two.html"); WaitFor(filename, "test/two.html", 5); } }
public void TestSingleFileProtocolHandler() { var filename = new Holder<string>(); using (var protocolHandler = new FileProtocolHandler(Context, "asset", FilenameProtocolHandler, (fn) => "text/html")) using (var window = new Window(Context)) { window.ChromeSend += (w, msg, args) => { if (msg == "filename") filename.Value = args[0]; }; window.NavigateTo("asset://test/foo.html"); WaitFor(filename, "test/foo.html", 5); } }