Bug 985596 - Updated shared assets & tests layout. r=Standard8

--HG--
rename : browser/components/loop/test/mocha-test/README.md => browser/components/loop/test/desktop-local/README.md
rename : browser/components/loop/test/mocha-test/client_test.js => browser/components/loop/test/desktop-local/client_test.js
rename : browser/components/loop/test/mocha-test/index.html => browser/components/loop/test/desktop-local/index.html
rename : browser/components/loop/test/mocha-test/panel_test.js => browser/components/loop/test/desktop-local/panel_test.js
This commit is contained in:
Nicolas Perriault 2014-05-29 21:13:42 +01:00
parent f82de50ab9
commit 8711ed2ba4
12 changed files with 59 additions and 15607 deletions

View File

@ -1,31 +1,12 @@
In order for the loop component to build, do the following:
In order for the loop component to build, run the make-links.sh script to
setup symlinks from the Gecko tree into your loop-client-repo for shared code,
noting that you'll need to put the correct path inside the [[ ]] placeholder
(and remove the [[ ]] characters).
* if you have an existing content/shared directory, move it out of the way:
$ export LOOP_CLIENT_REPO=[[/absolute-path/to/my/loop-client-repo/clone]]
$ ./make-links.sh
mv content/shared content/shared.old
* create a symlink to the authoritative version of the shared directory in your
loop-client repo. If you first set the env vars referenced below,
you should be able to copy-paste these lines:
ln -s ${LOOP_CLIENT_REPO_DIR}/static/shared \
${GECKO_SRC_DIR}/browser/components/loop/content/shared
Once you're done, the browser/components/loop/content should look something
like this:
$ ls -l !$
ls -l browser/components/loop/content
total 32
-rw-r--r-- 1 dmose staff 900 Mar 27 16:17 conversation.html
drwxr-xr-x 6 dmose staff 204 Mar 27 16:17 js
drwxr-xr-x 3 dmose staff 102 Mar 26 15:36 libs
-rw-r--r-- 1 dmose staff 2159 Mar 26 15:36 panel.html
lrwxr-xr-x 1 dmose staff 40 Mar 26 15:41 shared -> /Users/dmose/r/loop-client/static/shared
Note that changes to the shared directory affect both the standalone loop-client
and the desktop client. This means that sometimes, in order to
Note that changes to the shared directories affect both the standalone
loop-client and the desktop client. This means that sometimes, in order to
make a desktop client patch, you'll need to get reviews on patches to both
mozilla-central/gecko-dev as well as loop-client.
mozilla-central/gecko-dev as well as loop-client.

View File

@ -0,0 +1,25 @@
#!/bin/bash
if [ `basename $PWD` != "loop" ]; then
echo "this script must be executed in the loop directory"
exit -1
fi
if [ ! -d "$LOOP_CLIENT_REPO" ]; then
echo "LOOP_CLIENT_REPO in the environment must be set to a valid directory"
exit -1
fi
SHARED_CONTENT_TARGET=./content/shared
rm -f ${SHARED_CONTENT_TARGET}
SHARED_CONTENT=${LOOP_CLIENT_REPO}/content/shared
ln -s ${SHARED_CONTENT} ${SHARED_CONTENT_TARGET}
SHARED_TEST_TARGET=./test/shared
rm -f ${SHARED_TEST_TARGET}
SHARED_TEST=${LOOP_CLIENT_REPO}/test/shared
ln -s ${SHARED_TEST} ${SHARED_TEST_TARGET}

View File

@ -0,0 +1 @@
shared

View File

@ -6,7 +6,7 @@
<head>
<meta charset="utf-8">
<title>Loop mocha tests</title>
<link rel="stylesheet" media="all" href="../vendor/mocha-1.17.1.css">
<link rel="stylesheet" media="all" href="../shared/vendor/mocha-1.17.1.css">
</head>
<body>
<div id="mocha">
@ -34,13 +34,13 @@
};
</script>
<script src="../../content/libs/l10n.js"></script>
<script type="text/javascript" src="../../content/shared/libs/jquery-2.1.0.js"></script>
<script type="text/javascript" src="../../content/shared/libs/lodash-2.4.1.js"></script>
<script type="text/javascript" src="../../content/shared/libs/backbone-1.1.2.js"></script>
<script src="../../content/shared/libs/jquery-2.1.0.js"></script>
<script src="../../content/shared/libs/lodash-2.4.1.js"></script>
<script src="../../content/shared/libs/backbone-1.1.2.js"></script>
<!-- test dependencies -->
<script src="../vendor/mocha-1.17.1.js"></script>
<script src="../vendor/chai-1.9.0.js"></script>
<script src="../vendor/sinon-1.9.0.js"></script>
<script src="../shared/vendor/mocha-1.17.1.js"></script>
<script src="../shared/vendor/chai-1.9.0.js"></script>
<script src="../shared/vendor/sinon-1.9.0.js"></script>
<script>
chai.Assertion.includeStack = true;
mocha.setup('bdd');

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html>
<head>
<meta charset="utf-8">
<title>Loop test index</title>
</head>
<body>
<h1>Loop tests</h1>
<ul>
<li><a href="shared/">Shared tests</a></li>
<li><a href="desktop-local/">Local tests</a></li>
</ul>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,270 +0,0 @@
@charset "utf-8";
body {
margin:0;
}
#mocha {
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 60px 50px;
}
#mocha ul,
#mocha li {
margin: 0;
padding: 0;
}
#mocha ul {
list-style: none;
}
#mocha h1,
#mocha h2 {
margin: 0;
}
#mocha h1 {
margin-top: 15px;
font-size: 1em;
font-weight: 200;
}
#mocha h1 a {
text-decoration: none;
color: inherit;
}
#mocha h1 a:hover {
text-decoration: underline;
}
#mocha .suite .suite h1 {
margin-top: 0;
font-size: .8em;
}
#mocha .hidden {
display: none;
}
#mocha h2 {
font-size: 12px;
font-weight: normal;
cursor: pointer;
}
#mocha .suite {
margin-left: 15px;
}
#mocha .test {
margin-left: 15px;
overflow: hidden;
}
#mocha .test.pending:hover h2::after {
content: '(pending)';
font-family: arial, sans-serif;
}
#mocha .test.pass.medium .duration {
background: #c09853;
}
#mocha .test.pass.slow .duration {
background: #b94a48;
}
#mocha .test.pass::before {
content: '✓';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #00d6b2;
}
#mocha .test.pass .duration {
font-size: 9px;
margin-left: 5px;
padding: 2px 5px;
color: #fff;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
#mocha .test.pass.fast .duration {
display: none;
}
#mocha .test.pending {
color: #0b97c4;
}
#mocha .test.pending::before {
content: '◦';
color: #0b97c4;
}
#mocha .test.fail {
color: #c00;
}
#mocha .test.fail pre {
color: black;
}
#mocha .test.fail::before {
content: '✖';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #c00;
}
#mocha .test pre.error {
color: #c00;
max-height: 300px;
overflow: auto;
}
/**
* (1): approximate for browsers not supporting calc
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
* ^^ seriously
*/
#mocha .test pre {
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: calc(100% - 42px); /*(2)*/
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-border-radius: 3px;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-border-radius: 3px;
-moz-box-shadow: 0 1px 3px #eee;
border-radius: 3px;
}
#mocha .test h2 {
position: relative;
}
#mocha .test a.replay {
position: absolute;
top: 3px;
right: 0;
text-decoration: none;
vertical-align: middle;
display: block;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
background: #eee;
font-size: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-transition: opacity 200ms;
-moz-transition: opacity 200ms;
transition: opacity 200ms;
opacity: 0.3;
color: #888;
}
#mocha .test:hover a.replay {
opacity: 1;
}
#mocha-report.pass .test.fail {
display: none;
}
#mocha-report.fail .test.pass {
display: none;
}
#mocha-report.pending .test.pass,
#mocha-report.pending .test.fail {
display: none;
}
#mocha-report.pending .test.pass.pending {
display: block;
}
#mocha-error {
color: #c00;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 1px;
}
#mocha-stats {
position: fixed;
top: 15px;
right: 10px;
font-size: 12px;
margin: 0;
color: #888;
z-index: 1;
}
#mocha-stats .progress {
float: right;
padding-top: 0;
}
#mocha-stats em {
color: black;
}
#mocha-stats a {
text-decoration: none;
color: inherit;
}
#mocha-stats a:hover {
border-bottom: 1px solid #eee;
}
#mocha-stats li {
display: inline-block;
margin: 0 5px;
list-style: none;
padding-top: 11px;
}
#mocha-stats canvas {
width: 40px;
height: 40px;
}
#mocha code .comment { color: #ddd; }
#mocha code .init { color: #2f6fad; }
#mocha code .string { color: #5890ad; }
#mocha code .keyword { color: #8a6343; }
#mocha code .number { color: #2f6fad; }
@media screen and (max-device-width: 480px) {
#mocha {
margin: 60px 0px;
}
#mocha #stats {
position: absolute;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff