<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%
/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
%>      
<jsp:useBean id="template" scope="request" class="org.eclipse.cosmos.provisional.dr.ps.common.Template" /> 
 
<html>
	<head>
		<title>COSMOS Dojo Unit Tests</title>

<style type="text/css">
		@import "<%= template.getDojoBaseUrl() %>/dojo/resources/dojo.css";
		@import "<%= template.getDojoBaseUrl() %>/dijit/themes/tundra/tundra.css";
		@import "<%= template.getPage() %>/css/style.css";

</style>
<%= template.header() %>


		<script type="text/javascript">
			window.testUrl = "";
			window.testModule = "tests.org.eclipse.cosmos.tests.dr.module";

		</script>
		<script type="text/javascript">
			dojo.registerModulePath("tests.org.eclipse.cosmos","tests/org/eclipse/cosmos");
			dojo.registerModulePath("doh","<%= template.getDojoBaseUrl() %>/util/doh");
				
			try{
				dojo.require("doh.runner");
			}catch(e){
			}
		</script>
<script type='text/javascript' src='tests/org/eclipse/cosmos/tests/dr/drs/service/handler/_base.jsp'></script>
		<style type="text/css">
			@import "<%= template.getDojoBaseUrl() %>/dojo/resources/dojo.css";

			/*
			body {
				margin: 0px;
				padding: 0px;
				font-size: 13px;
				color: #292929;
				font-family: Myriad, Lucida Grande, Bitstream Vera Sans, Arial, Helvetica, sans-serif;
				*font-size: small;
				*font: x-small;
			}

			th, td {
				font-size: 13px;
				color: #292929;
				font-family: Myriad, Lucida Grande, Bitstream Vera Sans, Arial, Helvetica, sans-serif;
				font-weight: normal;
			}

			* body {
				line-height: 1.25em;
			}
			
			table {
				border-collapse: collapse;
			}
			*/

			#testLayout {
				position: relative;
				left: 0px;
				top: 0px;
				width: 100%;
				height: 100%;
				border: 1px solid black;
				border: 0px;
			}

			.tabBody {
				margin: 0px;
				padding: 0px;
				/*
				border: 1px solid black;
				*/
				background-color: #DEDEDE;
				border: 0px;
				width: 100%;
				height: 100%;
				position: absolute;
				left: 0px; 
				top: 0px;
				overflow: auto;
			}

			#logBody {
				padding-left: 5px;
				padding-top: 5px;
				font-family: Monaco, monospace;
				font-size: 11px;
				white-space: pre;
			}

			#progressOuter {
				background:#e9e9e9 url("http://svn.dojotoolkit.org/dojo/dijit/trunk/themes/tundra/dojoTundraGradientBg.png") repeat-x 0 0;
				/*
				border-color: #e8e8e8;
				*/
			}

			#progressInner {
				background: blue url("http://svn.dojotoolkit.org/dojo/dijit/trunk/themes/tundra/bar.gif") repeat-x 0 0;
				width: 0%;
				position: relative;
				left: 0px;
				top: 0px;
				height: 100%;
			}

			#play, #pause {
				font-family: Webdings;
				font-size: 1.4em;
				border: 1px solid #DEDEDE;
				cursor: pointer;
				padding-right: 0.5em;
			}

			.header {
				border: 1px solid #DEDEDE;
			}

			button.tab {
				border-width: 1px 1px 0px 1px;
				border-style: solid;
				border-color: #DEDEDE;
				margin-right: 5px;
			}

			#testListContainer {
				/*
				border: 1px solid black;
				*/
				position: relative;
				height: 99%;
				width: 100%;
				overflow: auto;
			}

			#testList {
				border-collapse: collapse;
				position: absolute;
				left: 0px;
				width: 100%;
			}

			#testList > tbody > tr > td {
				border-bottom: 1px solid #DEDEDE;
				border-right : 1px solid #DEDEDE;
				padding: 3px;
			}

			#testListHeader th {
				border-bottom: 1px solid #DEDEDE;
				border-right : 1px solid #DEDEDE;
				padding: 3px;
				font-weight: bolder;
				font-style: italic;
			}

			#toggleButtons {
				float: left;
				background-color: #DEDEDE;
			}

			tr.inProgress {
				background-color: #85afde;
			}

			tr.success {
				background-color: #7cdea7;
			}

			tr.failure {
				background-color: #de827b;
			}
		</style>
	</head>
	<body>
		<table id="testLayout" cellpadding="0" cellspacing="0" style="margin: 0;">
			<tr valign="top" height="40">
				<td colspan="2" id="logoBar">
					<h3 style="margin: 5px 5px 0px 5px; float: left;">COSMOS Unit Tests</h3>
					<img src="small_logo.png" height="40" style="margin: 0px 5px 0px 5px; float: right;">
					<span style="margin: 10px 5px 0px 5px; float: right;">
						<input type="checkbox" id="audio" name="audio">
						<label for="audio">sounds?</label>
					</span>
				</td>
			</tr>
			<tr valign="top" height="30">
				<td width="30%" class="header">
					<span id="toggleButtons" onclick="doh.togglePaused();">
						<button id="play">&#052;</button>
						<button id="pause" style="display: none;">&#059;</button>
					</span>
					<span id="runningStatus">
						<span id="pausedMsg">Stopped</span>
						<span id="playingMsg" style="display: none;">Tests Running</span>
					</span>
				</td>
				<td width="*" class="header" valign="bottom">
					<button class="tab" onclick="showTestPage();">Test Page</button>
					<button class="tab" onclick="showLogPage();">Log</button>
				</td>
			</tr>
			<tr valign="top" style="border: 0; padding: 0; margin: 0;">
				<td height="100%" style="border: 0; padding: 0; margin: 0;">
					<div id="testListContainer">
						<table cellpadding="0" cellspacing="0" border="0"
							width="100%" id="testList" style="margin: 0;">
							<thead>
								<tr id="testListHeader" style="border: 0; padding: 0; margin: 0;" >
									<th>&nbsp;</th>
									<th width="20">
										<input type="checkbox" checked 
											onclick="toggleRunAll();">
									</th>
									<th width="*" style="text-align: left;">test</th>
									<th width="50">time</th>
								</tr>
							</thead>
							<tbody valign="top">
								<tr id="groupTemplate" style="display: none;">
									<td style="font-family: Webdings; width: 15px;">&#052;</td>
									<td>
										<input type="checkbox" checked>
									</td>
									<td>group name</td>
									<td>10ms</td>
								</tr>
								<tr id="testTemplate" style="display: none;">
									<td>&nbsp;</td>
									<td>&nbsp;</td>
									<td style="padding-left: 20px;">test name</td>
									<td>10ms</td>
								</tr>
							</tbody>
						</table>
					</div>
				</td>
				<td>
					<div style="position: relative; width: 99%; height: 100%; top: 0px; left: 0px;">
						<div class="tabBody"
							style="z-index: 1;">
<pre id="logBody"></pre>
						</div>
						<iframe id="testBody" class="tabBody"
							style="z-index: 0;"></iframe>
					</div>
				</td>
			</tr>
		</table>
		<span id="hiddenAudio"></span>
	</body>
</html>

