Bug 1483730 - Return null from getFileForAdb if the adb file doesn't exit. r=jdescottes
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 17 Aug 2018 06:58:42 +0900
changeset 487167 f523b181c03f11aa78373eec6bcfd5ec5e2ec5bc
parent 487166 248f68b88c186f23650b4147c8e38005dd546710
child 487168 1e71e61d1623cf5409ebe0f6697c42bcf9452a60
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1483730
milestone63.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 1483730 - Return null from getFileForAdb if the adb file doesn't exit. r=jdescottes Summary: Depends on D3463 Reviewers: jdescottes Reviewed By: jdescottes Bug #: 1483730 Differential Revision: https://phabricator.services.mozilla.com/D3464
devtools/shared/adb/adb-binary.js
devtools/shared/adb/test/test_adb.js
--- a/devtools/shared/adb/adb-binary.js
+++ b/devtools/shared/adb/adb-binary.js
@@ -211,12 +211,17 @@ async function isUnpacked() {
  * @return {nsIFile}
  *        File object for the binary.
  */
 async function getFileForBinary() {
   if (!await isUnpacked() &&
       !await extractFiles()) {
     return null;
   }
-  return new FileUtils.File(ADB_BINARY_PATH);
+
+  const file = new FileUtils.File(ADB_BINARY_PATH);
+  if (!file.exists()) {
+    return null;
+  }
+  return file;
 }
 
 exports.getFileForBinary = getFileForBinary;
--- a/devtools/shared/adb/test/test_adb.js
+++ b/devtools/shared/adb/test/test_adb.js
@@ -96,19 +96,17 @@ add_task(async function testNoAdbJSON() 
   await extension.startup();
 
   const adbBinary = await getFileForBinary();
   equal(adbBinary, null);
 
   await extension.unload();
 });
 
-add_task({
-  skip_if: () => mozinfo.os == "win" // bug 1482008
-}, async function testNoTargetBinaries() {
+add_task(async function testNoTargetBinaries() {
   const extension = ExtensionTestUtils.loadExtension({
     manifest: {
       version: (extension_version++).toString(),
       applications: {
         gecko: { id: "adb@mozilla.org" }
       }
     },
     files: {