frmrtlrun.pp 668 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. unit frmrtlrun;
  2. {$mode objfpc}
  3. interface
  4. uses
  5. Classes, fpcunitreport, BrowserConsole, web;
  6. Type
  7. { TConsoleRunner }
  8. TConsoleRunner = Class(TRunForm)
  9. Private
  10. FRun : TJSHTMLButtonElement;
  11. function DoRunTest(aEvent: TJSMouseEvent): boolean;
  12. public
  13. procedure initialize; override;
  14. end;
  15. implementation
  16. { TConsoleRunner }
  17. function TConsoleRunner.DoRunTest(aEvent: TJSMouseEvent): boolean;
  18. begin
  19. Result:=False;
  20. ResetConsole;
  21. If Assigned(OnRun) then
  22. OnRun(Self);
  23. end;
  24. procedure TConsoleRunner.initialize;
  25. begin
  26. FRun:=TJSHTMLButtonElement(document.getElementById('RunTest'));
  27. FRun.onClick:=@DoRunTest;
  28. ResetConsole;
  29. end;
  30. end.