Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: compiler/javatests/com/google/dart/compiler/backend/common/TypeHeuristicImplementationTest.java

Issue 9211001: Ensure that temp files created by this test are deleted when the JVM exits. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/backend/common/TypeHeuristicImplementationTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/backend/common/TypeHeuristicImplementationTest.java b/compiler/javatests/com/google/dart/compiler/backend/common/TypeHeuristicImplementationTest.java
index 6e6d6ec35b8a04406931578f97b09c2caef36c19..89f28cc5c6d7b07f16e66b62e08ee99466bc5307 100644
--- a/compiler/javatests/com/google/dart/compiler/backend/common/TypeHeuristicImplementationTest.java
+++ b/compiler/javatests/com/google/dart/compiler/backend/common/TypeHeuristicImplementationTest.java
@@ -13,6 +13,7 @@ import com.google.dart.compiler.DartSourceTest;
import com.google.dart.compiler.DefaultCompilerConfiguration;
import com.google.dart.compiler.DefaultDartArtifactProvider;
import com.google.dart.compiler.MockLibrarySource;
+import com.google.dart.compiler.Source;
import com.google.dart.compiler.ast.DartBinaryExpression;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartExprStmt;
@@ -34,6 +35,7 @@ import com.google.dart.compiler.resolver.FieldElement;
import com.google.dart.compiler.resolver.MethodElement;
import com.google.dart.compiler.type.Type;
+import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
@@ -68,7 +70,18 @@ public class TypeHeuristicImplementationTest extends CompilerTestCase {
lib.addSource(src);
Map<URI, DartUnit> parsedUnits = new HashMap<URI, DartUnit>();
DefaultCompilerConfiguration config = new DefaultCompilerConfiguration();
- DefaultDartArtifactProvider provider = new DefaultDartArtifactProvider(Files.createTempDir());
+ File tempDir = Files.createTempDir();
+ tempDir.deleteOnExit();
+ DefaultDartArtifactProvider provider = new DefaultDartArtifactProvider(tempDir) {
+ @Override
+ protected File getArtifactFile(Source source, String part, String extension) {
+ File file = super.getArtifactFile(source, part, extension);
+ if (file != null) {
+ file.deleteOnExit();
+ }
+ return file;
+ }
+ };
DartCompilerListener listener = DartCompilerListener.EMPTY;
LibraryUnit libUnit = DartCompiler.analyzeLibrary(lib, parsedUnits, config, provider,
listener);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698