allow any android sdk version

This commit is contained in:
Devon Carew
2016-02-13 12:00:41 -08:00
parent 5a167615d3
commit dcf0b7bae6
25 changed files with 426 additions and 220 deletions

View File

@@ -0,0 +1,11 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:args/command_runner.dart';
import 'package:flutter_tools/src/runner/flutter_command.dart';
import 'package:flutter_tools/src/runner/flutter_command_runner.dart';
CommandRunner createTestCommandRunner(FlutterCommand command) {
return new FlutterCommandRunner()..addCommand(command);
}

View File

@@ -9,12 +9,25 @@ import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:test/test.dart';
void testUsingContext(String description, dynamic testMethod(), { Timeout timeout }) {
/// Return the test logger. This assumes that the current Logger is a BufferLogger.
BufferLogger get testLogger => context[Logger];
void testUsingContext(String description, dynamic testMethod(), {
Timeout timeout,
Map<Type, dynamic> overrides: const <Type, dynamic>{}
}) {
test(description, () {
AppContext testContext = new AppContext();
testContext[Logger] = new BufferLogger();
testContext[DeviceManager] = new MockDeviceManager();
overrides.forEach((Type type, dynamic value) {
testContext[type] = value;
});
if (!overrides.containsKey(Logger))
testContext[Logger] = new BufferLogger();
if (!overrides.containsKey(DeviceManager))
testContext[DeviceManager] = new MockDeviceManager();
return testContext.runInZone(testMethod);
}, timeout: timeout);