コード例 #1
0
ファイル: AdbRunnerTests.cs プロジェクト: mdh1418/xharness
    public void GetDevice()
    {
        var requiredArchitecture = "x86_64";
        var runner = new AdbRunner(_mainLog.Object, _processManager.Object, s_adbPath);
        var result = runner.GetDevice(requiredArchitectures: new[] { requiredArchitecture });

        VerifyAdbCall("devices", "-l");
        Assert.Contains(_fakeDeviceList, d => d.DeviceSerial == result.DeviceSerial);
    }
コード例 #2
0
ファイル: AdbRunnerTests.cs プロジェクト: mdh1418/xharness
    public void GetDeviceWithAppAndApiVersion()
    {
        var runner = new AdbRunner(_mainLog.Object, _processManager.Object, s_adbPath);
        var device = _fakeDeviceList.Single(d => d.ApiVersion == 31 && d.InstalledApplications.Contains("net.dot.E"));
        var result = runner.GetDevice(requiredInstalledApp: "net.dot.E", requiredApiVersion: 31);

        VerifyAdbCall("devices", "-l");
        Assert.Equal(device.DeviceSerial, result.DeviceSerial);
        Assert.Equal(device.ApiVersion, result.ApiVersion);
    }
コード例 #3
0
ファイル: AdbRunnerTests.cs プロジェクト: mdh1418/xharness
    public void GetDeviceWithArchitecture()
    {
        var requiredArchitecture = "x86";
        var runner = new AdbRunner(_mainLog.Object, _processManager.Object, s_adbPath);
        var result = runner.GetDevice(loadArchitecture: true, requiredArchitectures: new[] { requiredArchitecture });

        VerifyAdbCall("devices", "-l");
        VerifyAdbCall("-s", result.DeviceSerial, "shell", "getprop", "ro.product.cpu.abi");
        Assert.Contains(_fakeDeviceList, d => d.DeviceSerial == result.DeviceSerial && d.Architecture == result.Architecture);
    }
コード例 #4
0
ファイル: AdbRunnerTests.cs プロジェクト: mdh1418/xharness
    public void DumpBugReport()
    {
        var    runner = new AdbRunner(_mainLog.Object, _processManager.Object, s_adbPath);
        string pathToDumpBugReport = Path.Join(s_scratchAndOutputPath, Path.GetRandomFileName());

        runner.GetDevice(requiredDeviceId: _fakeDeviceList.First().DeviceSerial);
        runner.DumpBugReport(pathToDumpBugReport);
        VerifyAdbCall("bugreport", $"{pathToDumpBugReport}.zip");

        Assert.Equal("Sample BugReport Output", File.ReadAllText($"{pathToDumpBugReport}.zip"));
    }
コード例 #5
0
ファイル: AdbRunnerTests.cs プロジェクト: mdh1418/xharness
    public void GetDeviceWithApiVersion()
    {
        var runner = new AdbRunner(_mainLog.Object, _processManager.Object, s_adbPath);
        var device = _fakeDeviceList.Single(d => d.ApiVersion == 30);
        var result = runner.GetDevice(loadArchitecture: true, requiredApiVersion: 30);

        VerifyAdbCall("devices", "-l");
        Assert.Equal(device.DeviceSerial, result.DeviceSerial);
        Assert.Equal(device.ApiVersion, result.ApiVersion);
        Assert.Equal(device.Architecture, result.Architecture);
    }