Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/stub-modules/io.js

Issue 29354864: Issue 4223 - Migrate some more of adblockplustests (Closed)
Patch Set: Allow tests to be run from different directory Created Oct. 3, 2016, 6:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/signatures.js ('k') | test/stub-modules/prefs.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 exports.IO = {}; 1 //
2 // Fake nsIFile implementation for our I/O
3 //
4 function FakeFile(path)
5 {
6 this.path = path;
7 }
8 FakeFile.prototype =
9 {
10 get leafName()
11 {
12 return this.path;
13 },
14 set leafName(value)
15 {
16 this.path = value;
17 },
18 append: function(path)
19 {
20 this.path += path;
21 },
22 clone: function()
23 {
24 return new FakeFile(this.path);
25 },
26 get parent()
27 {
28 return {create: function() {}};
29 },
30 normalize: function() {}
31 };
32
33
34 exports.IO = {
35 resolveFilePath: function(path)
36 {
37 return new FakeFile(path);
38 },
39 statFile: function(path)
40 {
41 return true;
42 }
43 };
OLDNEW
« no previous file with comments | « test/signatures.js ('k') | test/stub-modules/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld