Bug 1466573 - Write profile prefs before constructing command. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 05 Jun 2018 15:08:07 +0100
changeset 807493 db50c534433534070409a2d6766050f5f9c5db39
parent 807395 91db0c695f0272f00bf92c81c471a85101056d96
child 807494 3e88f6f8e58c78209ddafe3e78769729731e8aea
child 807496 1de7a3680aa29396029e34cbd60163694ff015f6
push id113124
push userbmo:ato@sny.no
push dateThu, 14 Jun 2018 17:46:33 +0000
reviewerswhimboo
bugs1466573
milestone62.0a1
Bug 1466573 - Write profile prefs before constructing command. r?whimboo MozReview-Commit-ID: 5XWglxjQvZh
testing/mozbase/rust/mozrunner/src/runner.rs
--- a/testing/mozbase/rust/mozrunner/src/runner.rs
+++ b/testing/mozbase/rust/mozrunner/src/runner.rs
@@ -246,36 +246,36 @@ impl Runner for FirefoxRunner {
     where
         T: Into<Stdio>,
     {
         self.stderr = Some(stderr.into());
         self
     }
 
     fn start(mut self) -> Result<FirefoxProcess, RunnerError> {
+        self.profile.user_prefs()?.write()?;
+
         let stdout = self.stdout.unwrap_or_else(|| Stdio::inherit());
         let stderr = self.stderr.unwrap_or_else(|| Stdio::inherit());
 
         let mut cmd = Command::new(&self.binary);
         cmd.args(&self.args[..])
             .envs(&self.envs)
             .stdout(stdout)
             .stderr(stderr);
 
         if !self.args.iter().any(|x| is_profile_arg(x)) {
             cmd.arg("-profile").arg(&self.profile.path);
         }
         cmd.stdout(Stdio::inherit()).stderr(Stdio::inherit());
 
-        self.profile.user_prefs()?.write()?;
-
         info!("Running command: {:?}", cmd);
         let process = cmd.spawn()?;
         Ok(FirefoxProcess {
-            process: process,
+            process,
             profile: self.profile
         })
     }
 }
 
 fn parse_arg_name<T>(arg: T) -> Option<String>
 where
     T: AsRef<OsStr>,