Skip to content

Commit

Permalink
tests: html5 template
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Apr 5, 2024
1 parent 51d1ccb commit 619d30b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 24 deletions.
28 changes: 15 additions & 13 deletions test/project.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<meta title="MoonshineTestEditorCoreTests" package="net.prominic.moonshine.texteditor.tests" />
<app main="TestMain" />
<meta title="MoonshineTestEditorCoreTests" package="net.prominic.moonshine.texteditor.tests"/>
<app main="TestMain"/>

<source path="src" />
<source path="../src" />
<!-- no need to display anything for automated tests -->
<window hidden="true"/>

<source path="src"/>
<source path="../src"/>

<haxelib name="utest" />
<haxelib name="openfl" />
<haxelib name="actuate" />
<haxelib name="feathersui" />
<haxelib name="markdown-openfl-textfield" />
<haxelib name="moonshine-openfl-language-client" />
<haxelib name="utest"/>
<haxelib name="openfl"/>
<haxelib name="actuate"/>
<haxelib name="feathersui"/>
<haxelib name="markdown-openfl-textfield"/>
<haxelib name="moonshine-openfl-language-client"/>

<!--
a custom HTML template is required when using utest with OpenFL
-->
<!-- a custom HTML template is recommended for utest -->
<!-- it is strictly required for OpenFL 9.3 and older -->
<template path="templates" if="html5"/>
</project>
35 changes: 24 additions & 11 deletions test/templates/html5/template/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>::APP_TITLE::</title>
<script type="text/javascript" src="./::APP_FILE::.js"></script>
</head>
<body>
<noscript>Please enable JavaScript in your web browser to run tests.</noscript>
<script type="text/javascript">
lime.$scripts["::APP_FILE::"]();
</script>
</body>
<head>
<meta charset="utf-8" />
<title>::APP_TITLE::</title>
<script type="text/javascript" src="./::APP_FILE::.js"></script>
<style>
html,body{margin:0;padding:0;height:100%;}
::if (SET_OPENFL >= "9.4.0")::
#openfl-content{position:absolute;top:-100%;::if (WIN_BACKGROUND)::background:#000000;::end::width:::if (WIN_RESIZABLE)::100%::elseif (WIN_WIDTH > 0)::::WIN_WIDTH::px::else::100%::end::;height:::if (WIN_RESIZABLE)::100%::elseif (WIN_WIDTH > 0)::::WIN_HEIGHT::px::else::100%::end::;}
::end::
</style>
</head>
<body>
<noscript>Please enable JavaScript in your web browser to run tests.</noscript>
::if (SET_OPENFL >= "9.4.0")::
<div id="openfl-content"></div>
<script type="text/javascript">
lime.embed ("::APP_FILE::", "openfl-content", ::WIN_WIDTH::, ::WIN_HEIGHT::, { parameters: {} });
</script>
::else::
<script type="text/javascript">
lime.$scripts["::APP_FILE::"]();
</script>
::end::
</body>
</html>

0 comments on commit 619d30b

Please sign in to comment.