diff options
-rw-r--r-- | build/android/pylib/test_package_apk.py | 6 | ||||
-rw-r--r-- | testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java | 5 | ||||
-rw-r--r-- | testing/android/native_test_launcher.cc | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/build/android/pylib/test_package_apk.py b/build/android/pylib/test_package_apk.py index 6430f60..5c633cc 100644 --- a/build/android/pylib/test_package_apk.py +++ b/build/android/pylib/test_package_apk.py @@ -57,21 +57,19 @@ class TestPackageApk(TestPackage): # testing/android/java/src/org/chromium/native_test/ # ChromeNativeTestActivity.java and # testing/android/native_test_launcher.cc - return os.path.join(self.adb.GetExternalStorage(), - 'native_tests', 'test.fifo') + return '/data/data/org.chromium.native_test/files/test.fifo' def _ClearFifo(self): self.adb.RunShellCommand('rm -f ' + self._GetFifo()) def _WatchFifo(self, timeout): - i = 0 for i in range(5): if self.adb.FileExistsOnDevice(self._GetFifo()): print 'Fifo created...' break time.sleep(i) else: - sys.exit('Unable to find fifo on device %s ' % self._GetFifo()) + raise Exception('Unable to find fifo on device %s ' % self._GetFifo()) args = shlex.split(self.adb.Adb()._target_arg) args += ['shell', 'cat', self._GetFifo()] return pexpect.spawn('adb', args, timeout=timeout, logfile=sys.stdout) diff --git a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java b/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java index a93772a..b984c48 100644 --- a/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java +++ b/testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java @@ -70,10 +70,7 @@ public class ChromeNativeTestActivity extends Activity { private void runTests() { // This directory is used by build/android/pylib/test_package_apk.py. - File filesDir = new File(Environment.getExternalStorageDirectory(), - "native_tests/"); - filesDir.mkdirs(); - nativeRunTests(filesDir.getAbsolutePath(), getApplicationContext()); + nativeRunTests(getFilesDir().getAbsolutePath(), getApplicationContext()); } // Signal a failure of the native test loader to python scripts diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc index 99d9b29..ade30b2 100644 --- a/testing/android/native_test_launcher.cc +++ b/testing/android/native_test_launcher.cc @@ -118,7 +118,8 @@ int ArgsToArgv(const std::vector<std::string>& args, void CreateFIFO(const char* fifo_path) { unlink(fifo_path); - if (mkfifo(fifo_path, 0666)) { + // Default permissions for mkfifo is ignored, chmod is required. + if (mkfifo(fifo_path, 0666) || chmod(fifo_path, 0666)) { AndroidLogError("Failed to create fifo %s: %s\n", fifo_path, strerror(errno)); exit(EXIT_FAILURE); |