Unverified Commit 25c10d6a authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Replace testUsingContext with testWithoutContext in a few places (#82498)

parent c533ab65
......@@ -22,7 +22,7 @@ import 'package:meta/meta.dart';
import 'package:test/fake.dart';
import '../src/common.dart';
import '../src/context.dart';
import '../src/fake_process_manager.dart';
void main() {
group('Basic info', () {
......@@ -244,7 +244,7 @@ void main() {
expect(portForwarder.forwardedPorts.isEmpty, true);
});
testUsingContext('createDevFSWriter returns a LocalDevFSWriter', () {
testWithoutContext('createDevFSWriter returns a LocalDevFSWriter', () {
final FakeDesktopDevice device = setUpDesktopDevice();
expect(device.createDevFSWriter(null, ''), isA<LocalDevFSWriter>());
......
......@@ -2,24 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:io' as io; // ignore: dart_io_import
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/device_port_forwarder.dart';
import 'package:test/fake.dart';
import '../src/common.dart';
import '../src/context.dart';
void main() {
testUsingContext('dispose does not throw exception if no process is present', () {
testWithoutContext('dispose does not throw exception if no process is present', () {
final ForwardedPort forwardedPort = ForwardedPort(123, 456);
expect(forwardedPort.context, isNull);
forwardedPort.dispose();
});
testUsingContext('dispose kills process if process was available', () {
testWithoutContext('dispose kills process if process was available', () {
final FakeProcess process = FakeProcess();
final ForwardedPort forwardedPort = ForwardedPort.withContext(123, 456, process);
forwardedPort.dispose();
......
......@@ -20,7 +20,7 @@ import 'package:flutter_tools/src/project.dart';
import 'package:test/fake.dart';
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
final FakePlatform macOS = FakePlatform(
......@@ -196,7 +196,7 @@ void main() {
expect(await device.targetPlatformDisplayName, 'darwin-arm64');
});
testUsingContext('isSupportedForProject is false with no host app', () async {
testWithoutContext('isSupportedForProject is false with no host app', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final MacOSDevice device = MacOSDevice(
fileSystem: fileSystem,
......@@ -211,7 +211,7 @@ void main() {
expect(device.isSupportedForProject(flutterProject), false);
});
testUsingContext('executablePathForDevice uses the correct package executable', () async {
testWithoutContext('executablePathForDevice uses the correct package executable', () async {
final FakeMacOSApp package = FakeMacOSApp();
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
......
......@@ -9,7 +9,6 @@ import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/io.dart';
import '../src/common.dart';
import '../src/context.dart';
import 'test_utils.dart';
const String apkDebugMessage = 'A summary of your APK analysis can be found at: ';
......@@ -17,7 +16,7 @@ const String iosDebugMessage = 'A summary of your iOS bundle analysis can be fou
const String runDevToolsMessage = 'flutter pub global activate devtools; flutter pub global run devtools ';
void main() {
testUsingContext('--analyze-size flag produces expected output on hello_world for Android', () async {
testWithoutContext('--analyze-size flag produces expected output on hello_world for Android', () async {
final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world');
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final ProcessResult result = await processManager.run(<String>[
......
......@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/base/process.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import '../src/common.dart';
import '../src/context.dart';
import 'test_utils.dart';
const String _kInitialVersion = 'v1.9.1';
......@@ -46,7 +45,7 @@ void main() {
}
});
testUsingContext('Can upgrade and downgrade a Flutter checkout', () async {
testWithoutContext('Can upgrade and downgrade a Flutter checkout', () async {
final Directory testDirectory = parentDirectory.childDirectory('flutter');
testDirectory.createSync(recursive: true);
......
......@@ -8,7 +8,6 @@ import 'package:file/file.dart';
import 'package:file_testing/file_testing.dart';
import '../src/common.dart';
import '../src/context.dart';
import 'test_utils.dart';
void main() {
......@@ -22,7 +21,7 @@ void main() {
tryToDelete(tempDir);
});
testUsingContext('flutter app that depends on a non-Android plugin can still build for Android', () {
testWithoutContext('flutter app that depends on a non-Android plugin can still build for Android', () {
final String flutterRoot = getFlutterRoot();
final String flutterBin = fileSystem.path.join(
flutterRoot,
......
......@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/convert.dart';
import '../src/common.dart';
import '../src/context.dart';
import 'test_data/basic_project.dart';
import 'test_utils.dart';
......@@ -56,7 +55,7 @@ void main() {
tryToDelete(tempDir);
});
testUsingContext('flutter run --observatory-port', () async {
testWithoutContext('flutter run --observatory-port', () async {
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final int port = await getFreePort();
// If only --observatory-port is provided, --observatory-port will be used by DDS
......@@ -74,7 +73,7 @@ void main() {
await process.exitCode;
});
testUsingContext('flutter run --dds-port --observatory-port', () async {
testWithoutContext('flutter run --dds-port --observatory-port', () async {
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final int observatoryPort = await getFreePort();
int ddsPort = await getFreePort();
......@@ -97,7 +96,7 @@ void main() {
await process.exitCode;
});
testUsingContext('flutter run --dds-port', () async {
testWithoutContext('flutter run --dds-port', () async {
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final int ddsPort = await getFreePort();
// If only --dds-port is provided, --dds-port will be used by DDS and the VM service
......
......@@ -7,7 +7,6 @@
import 'package:flutter_tools/src/base/io.dart';
import '../src/common.dart';
import '../src/context.dart';
import 'test_utils.dart';
final String toolBackend = fileSystem.path.join(getFlutterRoot(), 'packages', 'flutter_tools', 'bin', 'tool_backend.dart');
......@@ -15,7 +14,7 @@ final String examplePath = fileSystem.path.join(getFlutterRoot(), 'examples', 'h
final String dart = fileSystem.path.join(getFlutterRoot(), 'bin', platform.isWindows ? 'dart.bat' : 'dart');
void main() {
testUsingContext('tool_backend.dart exits if PROJECT_DIR is not set', () async {
testWithoutContext('tool_backend.dart exits if PROJECT_DIR is not set', () async {
final ProcessResult result = await processManager.run(<String>[
dart,
toolBackend,
......@@ -27,7 +26,7 @@ void main() {
expect(result.stderr, contains('PROJECT_DIR environment variable must be set to the location of Flutter project to be built.'));
});
testUsingContext('tool_backend.dart exits if FLUTTER_ROOT is not set', () async {
testWithoutContext('tool_backend.dart exits if FLUTTER_ROOT is not set', () async {
// Removing parent environment means that batch script cannot be run.
final String dart = fileSystem.path.join(getFlutterRoot(), 'bin', 'cache', 'dart-sdk', 'bin', platform.isWindows ? 'dart.exe' : 'dart');
......@@ -44,7 +43,7 @@ void main() {
expect(result.stderr, contains('FLUTTER_ROOT environment variable must be set to the location of the Flutter SDK.'));
});
testUsingContext('tool_backend.dart exits if local engine does not match build mode', () async {
testWithoutContext('tool_backend.dart exits if local engine does not match build mode', () async {
final ProcessResult result = await processManager.run(<String>[
dart,
toolBackend,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment