Re-enable and fix the move_file_test.dart tests in the analysis server.

Change-Id: I633ea597dc5ed4540eda119766e9390cba0152ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100786
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
diff --git a/pkg/analysis_server/test/services/refactoring/move_file_disabled.dart b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
similarity index 85%
rename from pkg/analysis_server/test/services/refactoring/move_file_disabled.dart
rename to pkg/analysis_server/test/services/refactoring/move_file_test.dart
index 59cb53c..f8c8907 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_disabled.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -7,15 +7,11 @@
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
-import 'package:path/path.dart';
 import 'package:test/test.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
 import 'abstract_refactoring.dart';
 
-// TODO(jwren) These tests are currently disabled due to issues on Windows, next
-//  week we will look at getting them enabled. Disabled by having the file
-//  renamed and a change to ./test_all.dart.
 main() {
   defineReflectiveSuite(() {
     defineReflectiveTests(MoveFileTest);
@@ -27,10 +23,10 @@
   MoveFileRefactoring refactoring;
 
   test_file_containing_imports_exports_parts() async {
-    String pathA = '/home/test/000/1111/a.dart';
-    String pathB = '/home/test/000/1111/b.dart';
-    String pathC = '/home/test/000/1111/22/c.dart';
-    testFile = context.normalize('/home/test/000/1111/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    String pathB = convertPath('/home/test/000/1111/b.dart');
+    String pathC = convertPath('/home/test/000/1111/22/c.dart');
+    testFile = convertPath('/home/test/000/1111/test.dart');
     addSource('/absolute/uri.dart', '');
     addSource(pathA, 'part of lib;');
     addSource(pathB, "import 'test.dart';");
@@ -80,8 +76,8 @@
   }
 
   test_file_importedLibrary_down() async {
-    String pathA = '/home/test/000/1111/a.dart';
-    testFile = context.normalize('/home/test/000/1111/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    testFile = convertPath('/home/test/000/1111/test.dart');
     addSource(pathA, '''
 import 'test.dart';
 ''');
@@ -98,8 +94,8 @@
   }
 
   test_file_importedLibrary_sideways() async {
-    String pathA = '/home/test/000/1111/a.dart';
-    testFile = context.normalize('/home/test/000/1111/sub/folder/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    testFile = convertPath('/home/test/000/1111/sub/folder/test.dart');
     addSource(pathA, '''
 import 'sub/folder/test.dart';
 ''');
@@ -114,8 +110,8 @@
   }
 
   test_file_importedLibrary_up() async {
-    String pathA = '/home/test/000/1111/a.dart';
-    testFile = context.normalize('/home/test/000/1111/22/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    testFile = convertPath('/home/test/000/1111/22/test.dart');
     addSource(pathA, '''
 import '22/test.dart';
 ''');
@@ -133,9 +129,9 @@
   test_file_referenced_by_multiple_libraries() async {
     // This test fails because the search index doesn't support multiple uris for
     // a library, so only one of them is updated.
-    String pathA = '/home/test/000/1111/a.dart';
-    String pathB = '/home/test/000/b.dart';
-    testFile = context.normalize('/home/test/000/1111/22/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    String pathB = convertPath('/home/test/000/b.dart');
+    testFile = convertPath('/home/test/000/1111/22/test.dart');
     addSource(pathA, '''
 library lib;
 part '22/test.dart';
@@ -162,8 +158,8 @@
   }
 
   test_file_referenced_by_part() async {
-    String pathA = '/home/test/000/1111/a.dart';
-    testFile = context.normalize('/home/test/000/1111/22/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    testFile = convertPath('/home/test/000/1111/22/test.dart');
     addSource(pathA, '''
 library lib;
 part '22/test.dart';
@@ -221,8 +217,8 @@
     // If the file is a part in a library, and the part-of directive uses a URI
     // rather than a library name, that will need updating too (if the relative
     // path to the parent changes).
-    String pathA = '/home/test/000/1111/a.dart';
-    testFile = context.normalize('/home/test/000/1111/22/test.dart');
+    String pathA = convertPath('/home/test/000/1111/a.dart');
+    testFile = convertPath('/home/test/000/1111/22/test.dart');
     addSource(pathA, '''
 library lib;
 part '22/test.dart';
diff --git a/pkg/analysis_server/test/services/refactoring/test_all.dart b/pkg/analysis_server/test/services/refactoring/test_all.dart
index 9fc1666..a63865d 100644
--- a/pkg/analysis_server/test/services/refactoring/test_all.dart
+++ b/pkg/analysis_server/test/services/refactoring/test_all.dart
@@ -11,6 +11,7 @@
 import 'extract_widget_test.dart' as extract_widget_test;
 import 'inline_local_test.dart' as inline_local_test;
 import 'inline_method_test.dart' as inline_method_test;
+import 'move_file_test.dart' as move_file_test;
 import 'naming_conventions_test.dart' as naming_conventions_test;
 import 'rename_class_member_test.dart' as rename_class_member_test;
 import 'rename_constructor_test.dart' as rename_constructor_test;
@@ -30,8 +31,7 @@
     extract_widget_test.main();
     inline_local_test.main();
     inline_method_test.main();
-    // TODO(jwren) commenting out all move_file_test due to windows bot failures
-    // move_file_test.main();
+    move_file_test.main();
     naming_conventions_test.main();
     rename_class_member_test.main();
     rename_constructor_test.main();