Esempio n. 1
0
def main():
    if len(sys.argv) <= 1:
        print "Usage: monkeyrunner DroidReplayer.py TRACE_PATH"
        print "The trace must be generated from getevent -lt [EVDEV]"
        return 1
    print "Replay started"
    pl = Pipeline()
    pl.addStep(dtm.TextFileLineReader(sys.argv[1]))
    pl.addStep(dtm.RawTraceParser())
    pl.addStep(dtm.MultiTouchTypeAParser())
    pl.addStep(dtm.RelativeTimingConverter())
    dev = EMonkeyDevice()
    pl.addStep(dtm.DeviceAdjuster(dev))
    pl.addStep(dtm.FingerDecomposer())
    pl.addStep(GestureReplayEventWrapper())
    # this step might be necessary for a tablet
    # pl.addStep(dtm.TrailScaler(0.8,0.8))
    # pl.addStep(dtm.TimeScaler(0.25))
    # trouble maker
    # pl.addStep(TroubleInjector())
    #replayers = [MonkeyHelperReplayer(dev), TroubleReplayer(dev)]
    #pl.addStep(CompositeReplayer(replayers))
    pl.addStep(MonkeyHelperReplayer(dev))
    pl.addStep(dtm.GenericPrinter())
    pl.execute()
    print "Replay finished"
Esempio n. 2
0
def main():
    if len(sys.argv) <= 1:
        print "Usage: monkeyrunner DroidReplayer.py TRACE_PATH"
        print "The trace must be generated from getevent -lt [EVDEV]"
        return 1
    print "Replay started"
    pl = Pipeline()
    pl.addStep(dtm.TextFileLineReader(sys.argv[1]))
    pl.addStep(dtm.RawTraceParser())
    pl.addStep(dtm.MultiTouchTypeAParser())
    pl.addStep(dtm.RelativeTimingConverter())
    dev = EMonkeyDevice()
    pl.addStep(dtm.DeviceAdjuster(dev))
    pl.addStep(dtm.FingerDecomposer())
    pl.addStep(GestureReplayEventWrapper())
    # this step might be necessary for a tablet
    # pl.addStep(dtm.TrailScaler(0.8,0.8))
    # pl.addStep(dtm.TimeScaler(0.25))
    # trouble maker
    # pl.addStep(TroubleInjector())
    #replayers = [MonkeyHelperReplayer(dev), TroubleReplayer(dev)]
    #pl.addStep(CompositeReplayer(replayers))
    pl.addStep(MonkeyHelperReplayer(dev))
    pl.addStep(dtm.GenericPrinter())
    pl.execute()
    print "Replay finished"
Esempio n. 3
0
def main():
    # capture three samples and automatically scrolls five times
    SAMPLE_COUNT = 3
    REPEAT_COUNT = 5
    print "learning the pace of scrolling"
    pl = Pipeline()
    reader = LiveGeteventReader()
    pl.addStep(reader)
    pl.addStep(dtm.RawTraceParser())
    pl.addStep(dtm.MultiTouchTypeAParser())
    pl.addStep(dtm.RelativeTimingConverter())
    pl.addStep(dtm.FingerDecomposer())
    learner = AutoScrollingLearner(reader, SAMPLE_COUNT)
    pl.addStep(learner)
    pl.execute()
    (waitTime, xdelta, ydelta, duration, pointCount) = learner.getSpeedAndDelta()
    print "User scrolling parameters learned"
    device = EMonkeyDevice()
    (xmiddle, ymiddle) = (device.displayWidth / 2, device.displayHeight / 2)
    start = (xmiddle - xdelta / 2, ymiddle - ydelta / 2)
    end = (xmiddle + xdelta / 2, ymiddle + ydelta / 2)
    for _ in range(REPEAT_COUNT):
        device.sleep(waitTime)
        device.drag(start, end, duration, pointCount)
    print 'done'
Esempio n. 4
0
def main():
    # capture three samples and automatically scrolls five times
    SAMPLE_COUNT = 3
    REPEAT_COUNT = 5
    print "learning the pace of scrolling"
    pl = Pipeline()
    reader = LiveGeteventReader()
    pl.addStep(reader)
    pl.addStep(dtm.RawTraceParser())
    pl.addStep(dtm.MultiTouchTypeAParser())
    pl.addStep(dtm.RelativeTimingConverter())
    pl.addStep(dtm.FingerDecomposer())
    learner = AutoScrollingLearner(reader, SAMPLE_COUNT)
    pl.addStep(learner)
    pl.execute()
    (waitTime, xdelta, ydelta, duration,
     pointCount) = learner.getSpeedAndDelta()
    print "User scrolling parameters learned"
    device = EMonkeyDevice()
    (xmiddle, ymiddle) = (device.displayWidth / 2, device.displayHeight / 2)
    start = (xmiddle - xdelta / 2, ymiddle - ydelta / 2)
    end = (xmiddle + xdelta / 2, ymiddle + ydelta / 2)
    for _ in range(REPEAT_COUNT):
        device.sleep(waitTime)
        device.drag(start, end, duration, pointCount)
    print 'done'
def main():
    print "Replay started"
    pl = Pipeline()
    pl.addStep(EventGenerator(interval=3000, number=1000))
    pl.addStep(TroubleInjector())
    dev = dm.getDevice()
    pl.addStep(TroubleReplayer(dev))
    pl.execute()
    print "Replay finished"
def main():
    print "Replay started"
    pl = Pipeline()
    pl.addStep(EventGenerator(interval=3000,number=1000))
    pl.addStep(TroubleInjector())
    dev = dm.getDevice()
    pl.addStep(TroubleReplayer(dev))
    pl.execute()
    print "Replay finished"
Esempio n. 7
0
        begin_time = cur_time()
        rand.seed(seed_)
        for iter_ in range(iterations):
            print('Computing iteration %d of %d, time=%f.' %
                  (iter_ + 1, iterations, (cur_time() - begin_time) / 60))
            data = getExperimentsFromParameterRanges(
                methodNames_parameters, list_of_splits, list_of_systemCounts,
                list_of_entityCounts, list_of_signValues, list_of_cutoffs,
                system_id_rank, totalRanks, bootstrapSize)
            pipe = Pipeline([computeSwapRate],
                            nr_threads=nr_threads,
                            update_interval=100,
                            verbose=verbose)
            pipe.execute(
                data,
                f_result_handler=experiment_results.handleExperimentResult,
                chunksize=10,
                pool=pool)
        print('Done computing ASL rate and swap method. Time: %f\n' %
              ((cur_time() - begin_time) / 60))

    if useErrTie:
        print(
            'Computing Error and Tie rate'
        )  #computes: error and tie rate, relRate, signRate (without replacement)
        begin_time = cur_time()
        rand.seed(seed_)
        for iter_ in range(iterations):
            print('Computing iteration %d of %d, time=%f.' %
                  (iter_ + 1, iterations, (cur_time() - begin_time) / 60))
            data = getExperimentsFromParameterRanges(