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

Side by Side Diff: pkg/watcher/test/utils.dart

Issue 25731003: Use Directory.systemTemp getter in pkg subdirectory of repository. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix formatting Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/scheduled_test/test/scheduled_process_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library watcher.test.utils; 5 library watcher.test.utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 28 matching lines...) Expand all
39 void initConfig() { 39 void initConfig() {
40 useCompactVMConfiguration(); 40 useCompactVMConfiguration();
41 filterStacks = true; 41 filterStacks = true;
42 } 42 }
43 43
44 /// Creates the sandbox directory the other functions in this library use and 44 /// Creates the sandbox directory the other functions in this library use and
45 /// ensures it's deleted when the test ends. 45 /// ensures it's deleted when the test ends.
46 /// 46 ///
47 /// This should usually be called by [setUp]. 47 /// This should usually be called by [setUp].
48 void createSandbox() { 48 void createSandbox() {
49 var dir = new Directory("").createTempSync(); 49 var dir = Directory.systemTemp.createTempSync('watcher_test_');
50 _sandboxDir = dir.path; 50 _sandboxDir = dir.path;
51 51
52 _mockFileModificationTimes = new Map<String, int>(); 52 _mockFileModificationTimes = new Map<String, int>();
53 mockGetModificationTime((path) { 53 mockGetModificationTime((path) {
54 path = p.normalize(p.relative(path, from: _sandboxDir)); 54 path = p.normalize(p.relative(path, from: _sandboxDir));
55 55
56 // Make sure we got a path in the sandbox. 56 // Make sure we got a path in the sandbox.
57 assert(p.isRelative(path) && !path.startsWith("..")); 57 assert(p.isRelative(path) && !path.startsWith(".."));
58 58
59 return new DateTime.fromMillisecondsSinceEpoch( 59 return new DateTime.fromMillisecondsSinceEpoch(
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 Description describe(Description description) { 221 Description describe(Description description) {
222 description.add("$type $path"); 222 description.add("$type $path");
223 } 223 }
224 224
225 bool matches(item, Map matchState) => 225 bool matches(item, Map matchState) =>
226 item is WatchEvent && 226 item is WatchEvent &&
227 item.type == type && 227 item.type == type &&
228 p.normalize(item.path) == p.normalize(path); 228 p.normalize(item.path) == p.normalize(path);
229 } 229 }
OLDNEW
« no previous file with comments | « pkg/scheduled_test/test/scheduled_process_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698