Bug 874425 - Add more logging to attempt to find out source of negative durations under Windows. r=yoric
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Fri, 23 Aug 2013 10:06:33 -0400
changeset 143977 816c1730c8ece1fb15834370843bea2432d6de18
parent 143976 de82a0040f1ab9c5f514fae59f8c8d1f6eadcc12
child 143978 617b9050b5ed0d4c9d814038cbb99dd6f17e0099
push id2327
push userryanvm@gmail.com
push dateFri, 23 Aug 2013 14:07:00 +0000
treeherderfx-team@816c1730c8ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric
bugs874425
milestone26.0a1
Bug 874425 - Add more logging to attempt to find out source of negative durations under Windows. r=yoric
toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
--- a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
+++ b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
@@ -867,16 +867,17 @@ let test_system_shutdown = maketest("sys
   });
 });
 
 /**
  * Test optional duration reporting that can be used for telemetry.
  */
 let test_duration = maketest("duration", function duration(test) {
   return Task.spawn(function() {
+    Services.prefs.setBoolPref("toolkit.osfile.log", true);
     // Options structure passed to a OS.File copy method.
     let copyOptions = {
       // This field should be overridden with the actual duration
       // measurement.
       outExecutionDuration: null
     };
     let currentDir = yield OS.File.getCurrentDirectory();
     let pathSource = OS.Path.join(currentDir, EXISTING_FILE);
@@ -942,17 +943,17 @@ let test_duration = maketest("duration",
       tmpPath: tmpPath
     };
     backupDuration = writeAtomicOptions.outExecutionDuration;
 
     yield OS.File.writeAtomic(pathDest, contents, writeAtomicOptions);
     test.ok(copyOptions.outExecutionDuration >= backupDuration, "duration has increased 3");
     OS.File.remove(pathDest);
 
-    Services.prefs.setBoolPref("toolkit.osfile.log", true);
     OS.Shared.TEST = true;
 
     // Testing an operation that doesn't take arguments at all
     let file = yield OS.File.open(pathSource);
     yield file.stat();
     yield file.close();
+    Services.prefs.setBoolPref("toolkit.osfile.log", false);
   });
 });