Bug 784373 - Test setPosition without optional argument. r=froydnj
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Tue, 28 Aug 2012 13:23:47 -0400
changeset 103680 054229ba8fd6663cb192f7663dd374146f30bc45
parent 103679 44cfdb8eba09def2914ce7e5c1486b5d09a94509
child 103681 04d13cf166ab1c0c6d765ff22551c0cee9199c44
push id14110
push userryanvm@gmail.com
push dateTue, 28 Aug 2012 17:23:53 +0000
treeherdermozilla-inbound@04d13cf166ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs784373
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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");