Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#1078 from etiennesegonzac/resurrect-tests
Browse files Browse the repository at this point in the history
Resurrecting the tests
  • Loading branch information
vingtetun committed Mar 30, 2012
2 parents 1deb245 + 49bc5ee commit 4911bb3
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -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"


###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_a_test_framework.js
@@ -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');
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_clock_stopwatch.js
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
yield testApp('../clock/clock.html', testStopwatch);
yield testApp('http://clock.gaiamobile.org/', testStopwatch);
finish();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/browser_clock_timer.js
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
yield testApp('../clock/clock.html', testTimer);
yield testApp('http://clock.gaiamobile.org/', testTimer);
finish();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/browser_dialer_call_from_contacts.js
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/browser_dialer_contact_intent.js
Expand Up @@ -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;
}
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_dialer_contacts_edition.js
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_dialer_contacts_search.js
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_dialer_history.js
@@ -1,5 +1,5 @@
function generatorTest() {
yield testApp('../dialer/dialer.html', testDialerHistory);
yield testApp('http://dialer.gaiamobile.org/', testDialerHistory);
}

function testDialerHistory(window, document, nextStep) {
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_dialer_keypad_and_dial.js
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
yield testApp('../dialer/dialer.html', testDialerKeypad);
yield testApp('http://dialer.gaiamobile.org/', testDialerKeypad);
finish();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/browser_dialer_phone_number_sanitizing.js
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
yield testApp('../dialer/dialer.html', testDialerSanitizing);
yield testApp('http://dialer.gaiamobile.org/', testDialerSanitizing);
finish();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/browser_sms_conversation.js
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
yield testApp('../sms/sms.html', testSMSConversation);
yield testApp('http://sms.gaiamobile.org/', testSMSConversation);
finish();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/browser_sms_new.js
@@ -1,6 +1,6 @@
function generatorTest() {
waitForExplicitFinish();
yield testApp('../sms/sms.html', testSMSNew);
yield testApp('http://sms.gaiamobile.org/', testSMSNew);
finish();
}

Expand Down
3 changes: 2 additions & 1 deletion tests/head.js
Expand Up @@ -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) {...}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4911bb3

Please sign in to comment.