"Fossies" - the Fresh Open Source Software Archive

Member "flutter-1.22.4/dev/devicelab/bin/tasks/smoke_test_device.dart" (13 Nov 2020, 827 Bytes) of package /linux/misc/flutter-1.22.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Dart source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Copyright 2014 The Flutter Authors. All rights reserved.
    2 // Use of this source code is governed by a BSD-style license that can be
    3 // found in the LICENSE file.
    4 
    5 import 'dart:async';
    6 
    7 import 'package:flutter_devicelab/framework/framework.dart';
    8 import 'package:flutter_devicelab/framework/adb.dart';
    9 
   10 /// Smoke test of a successful task.
   11 Future<void> main() async {
   12   deviceOperatingSystem = DeviceOperatingSystem.fake;
   13   await task(() async {
   14     final Device device = await devices.workingDevice;
   15     if (device.deviceId == 'FAKE_SUCCESS')
   16       return TaskResult.success(<String, dynamic>{
   17         'metric1': 42,
   18         'metric2': 123,
   19         'not_a_metric': 'something',
   20       }, benchmarkScoreKeys: <String>[
   21         'metric1',
   22         'metric2',
   23       ]);
   24     else
   25       return TaskResult.failure('Failed');
   26   });
   27 }