forked from brycecurtis/mobile-spec
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added map & orientation tests; expanded contacts.find test
- Loading branch information
Ryan Willoughby
committed
Dec 14, 2009
1 parent
860609b
commit 87c7929
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Tests.prototype.MapTests = function() { | ||
module('Map (navigator.map)'); | ||
test("should exist", function() { | ||
expect(1); | ||
ok(navigator.map != null, "navigator.map should not be null."); | ||
}); | ||
test("should contain a show function", function() { | ||
expect(2); | ||
ok(navigator.map.show != null, "navigator.map.show should not be null."); | ||
ok(typeof navigator.map.show == 'function', "navigator.map.show should be a function."); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Tests.prototype.OrientationTests = function() { | ||
module('Orientation (navigator.orientation)'); | ||
test("should exist", function() { | ||
expect(1); | ||
ok(navigator.orientation != null, "navigator.orientation should not be null."); | ||
}); | ||
test("should have an initially null lastPosition property", function() { | ||
expect(1); | ||
ok(navigator.orientation.currentOrientation == null, "navigator.orientation.currentOrientation should be initially null."); | ||
}); | ||
test("should contain a getCurrentOrientation function", function() { | ||
expect(2); | ||
ok(navigator.orientation.getCurrentOrientation != null, "navigator.orientation.getCurrentOrientation should not be null."); | ||
ok(typeof navigator.orientation.getCurrentOrientation == 'function', "navigator.orientation.getCurrentOrientation should be a function."); | ||
}); | ||
test("should contain a watchOrientation function", function() { | ||
expect(2); | ||
ok(navigator.orientation.watchOrientation != null, "navigator.orientation.watchOrientation should not be null."); | ||
ok(typeof navigator.orientation.watchOrientation == 'function', "navigator.orientation.watchOrientation should be a function."); | ||
}); | ||
test("getCurrentOrientation success callback should be called with an Orientation enumeration", function() { | ||
expect(2); | ||
stop(tests.TEST_TIMEOUT); | ||
var win = function(orient) { | ||
ok(0 <= orient <= 6, "Position object returned in getCurrentPosition success callback is a valid DisplayOrientation value."); | ||
equals(orient, navigator.orientation.currentOrientation, "Orientation value returned in getCurrentOrientation success callback equals navigator.orientation.currentOrientation."); | ||
start(); | ||
}; | ||
var fail = function() { start(); }; | ||
navigator.orientation.getCurrentOrientation(win, fail); | ||
}); | ||
// TODO: Need to test watchPosition success callback, test that makes sure clearPosition works (how to test that a timer is getting cleared?) | ||
}; |