|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 package org.mozilla.gecko.background.healthreport; |
|
5 |
|
6 import java.io.File; |
|
7 import java.io.FileNotFoundException; |
|
8 import java.io.IOException; |
|
9 |
|
10 import org.json.JSONException; |
|
11 import org.json.JSONObject; |
|
12 import org.mozilla.gecko.background.healthreport.ProfileInformationCache; |
|
13 |
|
14 public class MockProfileInformationCache extends ProfileInformationCache { |
|
15 public MockProfileInformationCache(String profilePath) { |
|
16 super(profilePath); |
|
17 } |
|
18 |
|
19 public boolean isInitialized() { |
|
20 return this.initialized; |
|
21 } |
|
22 public boolean needsWrite() { |
|
23 return this.needsWrite; |
|
24 } |
|
25 public File getFile() { |
|
26 return this.file; |
|
27 } |
|
28 |
|
29 public void writeJSON(JSONObject toWrite) throws IOException { |
|
30 writeToFile(toWrite); |
|
31 } |
|
32 |
|
33 public JSONObject readJSON() throws FileNotFoundException, JSONException { |
|
34 return readFromFile(); |
|
35 } |
|
36 |
|
37 public void setInitialized(final boolean initialized) { |
|
38 this.initialized = initialized; |
|
39 } |
|
40 } |