Permalink
Browse files

Merge pull request #1078 from etiennesegonzac/resurrect-tests

Resurrecting the tests
  • Loading branch information...
2 parents 1deb245 + 49bc5ee commit 4911bb378379f14457febce5e95fb390b54e7bf5 @vingtetun vingtetun committed Mar 30, 2012
View
@@ -117,15 +117,15 @@ INJECTED_GAIA = "$(MOZ_TESTS)/browser/gaia"
TEST_PATH=gaia/tests/${TEST_FILE}
# XXX This variable should be removed once make preferences is implemented
-B2G_HOMESCREEN?=file://$(CURDIR)/index.html
+B2G_HOMESCREEN?=http://homescreen.gaiamobile.org/
.PHONY: tests
-tests:
+tests: manifests offline
echo "Checking if the mozilla build has tests enabled..."
test -d $(MOZ_TESTS) || (echo "Please ensure you don't have |ac_add_options --disable-tests| in your mozconfig." && exit 1)
echo "Checking the injected Gaia..."
- test -L $(INJECTED_GAIA) || ln -s $(GAIA) $(INJECTED_GAIA)
- TEST_PATH=$(TEST_PATH) make -C $(MOZ_OBJDIR) mochitest-browser-chrome EXTRA_TEST_ARGS=--browser-arg=""
+ test -L $(INJECTED_GAIA) || ln -s $(CURDIR) $(INJECTED_GAIA)
+ TEST_PATH=$(TEST_PATH) make -C $(MOZ_OBJDIR) mochitest-browser-chrome EXTRA_TEST_ARGS="--browser-arg=\"\" --extra-profile-file=$(CURDIR)/profile/webapps --extra-profile-file=$(CURDIR)/profile/OfflineCache"
###############################################################################
@@ -1,5 +1,5 @@
function generatorTest() {
- yield testApp('../dialer/dialer.html', function(window, document, nextStep) {
+ yield testApp('http://dialer.gaiamobile.org/', function(window, document, nextStep) {
ok(window.document === document, 'window and document are related');
ok(document.readyState === 'complete', 'document fully loaded');
ok(typeof nextStep === 'function', 'nextStep func is okay');
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
- yield testApp('../clock/clock.html', testStopwatch);
+ yield testApp('http://clock.gaiamobile.org/', testStopwatch);
finish();
}
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
- yield testApp('../clock/clock.html', testTimer);
+ yield testApp('http://clock.gaiamobile.org/', testTimer);
finish();
}
@@ -9,7 +9,7 @@ function generatorTest() {
});
yield navigator.mozContacts.save(testContact).onsuccess = nextStep;
- yield testApp('../dialer/dialer.html', testCallFromContacts);
+ yield testApp('http://dialer.gaiamobile.org/', testCallFromContacts);
yield navigator.mozContacts.remove(testContact).onsuccess = nextStep;
}
@@ -8,7 +8,7 @@ function generatorTest() {
});
yield navigator.mozContacts.save(testContact).onsuccess = nextStep;
- yield testApp('../dialer/dialer.html', testContactIntent);
+ yield testApp('http://dialer.gaiamobile.org/', testContactIntent);
yield navigator.mozContacts.remove(testContact).onsuccess = nextStep;
}
@@ -19,7 +19,7 @@ function testContactIntent(window, document, nextStep) {
hidden: false
}
};
- window.visibilityChanged('../dialer/dialer.html?choice=contact', fakeEvt);
+ window.visibilityChanged('http://dialer.gaiamobile.org/index.html?choice=contact', fakeEvt);
ok(!document.getElementById('contacts-view').hidden,
'Contact view displayed');
@@ -1,6 +1,6 @@
function generatorTest() {
// Launch the dialer app
- yield testApp('../dialer/dialer.html', testContactsEdition);
+ yield testApp('http://dialer.gaiamobile.org/', testContactsEdition);
}
function testContactsEdition(window, document, nextStep) {
@@ -11,7 +11,7 @@ function generatorTest() {
yield navigator.mozContacts.save(testContact).onsuccess = nextStep;
// Launch the dialer app
- yield testApp('../dialer/dialer.html', testContactsSearch);
+ yield testApp('http://dialer.gaiamobile.org/', testContactsSearch);
// Remove the contact
navigator.mozContacts.remove(testContact);
@@ -1,5 +1,5 @@
function generatorTest() {
- yield testApp('../dialer/dialer.html', testDialerHistory);
+ yield testApp('http://dialer.gaiamobile.org/', testDialerHistory);
}
function testDialerHistory(window, document, nextStep) {
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
- yield testApp('../dialer/dialer.html', testDialerKeypad);
+ yield testApp('http://dialer.gaiamobile.org/', testDialerKeypad);
finish();
}
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
- yield testApp('../dialer/dialer.html', testDialerSanitizing);
+ yield testApp('http://dialer.gaiamobile.org/', testDialerSanitizing);
finish();
}
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
- yield testApp('../sms/sms.html', testSMSConversation);
+ yield testApp('http://sms.gaiamobile.org/', testSMSConversation);
finish();
}
View
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
- yield testApp('../sms/sms.html', testSMSNew);
+ yield testApp('http://sms.gaiamobile.org/', testSMSNew);
finish();
}
View
@@ -85,7 +85,7 @@ function silentOK(condition, message) {
// Write tests like this:
//
// function generatorTest() {
-// yield testApp("../dialer/dialer.html", dialerTest)
+// yield testApp("http://dialer.gaiamobile.org/", dialerTest)
// }
//
// function dialerTest(window, document, nextStep) {...}
@@ -141,6 +141,7 @@ function testApp(url, testfunc) {
silentOK(!contentWin.LockScreen.locked, 'screen did not unlock');
// Find all the icons on the homescreen
+ yield until(function() contentDoc.querySelectorAll('#apps > .page > .icon').length > 0, nextStep);
var icons = contentDoc.querySelectorAll('#apps > .page > .icon');
silentOK(icons.length > 0, 'no homescreen icons found');
var icon = null;

0 comments on commit 4911bb3

Please sign in to comment.