Bug 784373 - Test setPosition without optional argument. r=froydnj
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Tue, 28 Aug 2012 13:23:47 -0400
changeset 105719 054229ba8fd6663cb192f7663dd374146f30bc45
parent 105718 44cfdb8eba09def2914ce7e5c1486b5d09a94509
child 105720 04d13cf166ab1c0c6d765ff22551c0cee9199c44
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersfroydnj
bugs784373
milestone18.0a1
Bug 784373 - Test setPosition without optional argument. r=froydnj
toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js
+++ b/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js
@@ -486,16 +486,22 @@ function test_position() {
   let file = OS.File.open(src_file_name);
   is(file.getPosition(), 0, "test_position: Initial position is 0");
 
   let size = 0 + file.stat().size; // Hack: We can remove this 0 + once 776259 has landed
 
   file.setPosition(ARBITRARY_POSITION, OS.File.POS_START);
   is(file.getPosition(), ARBITRARY_POSITION, "test_position: Setting position from start");
 
+  file.setPosition(0, OS.File.POS_START);
+  is(file.getPosition(), 0, "test_position: Setting position from start back to 0");
+
+  file.setPosition(ARBITRARY_POSITION);
+  is(file.getPosition(), ARBITRARY_POSITION, "test_position: Setting position without argument");
+
   file.setPosition(-ARBITRARY_POSITION, OS.File.POS_END);
   is(file.getPosition(), size - ARBITRARY_POSITION, "test_position: Setting position from end");
 
   file.setPosition(ARBITRARY_POSITION, OS.File.POS_CURRENT);
   is(file.getPosition(), size, "test_position: Setting position from current");
 
   file.close();
   ok(true, "test_position: Complete");