1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/tests/background/junit3/src/healthreport/MockProfileInformationCache.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +package org.mozilla.gecko.background.healthreport; 1.8 + 1.9 +import java.io.File; 1.10 +import java.io.FileNotFoundException; 1.11 +import java.io.IOException; 1.12 + 1.13 +import org.json.JSONException; 1.14 +import org.json.JSONObject; 1.15 +import org.mozilla.gecko.background.healthreport.ProfileInformationCache; 1.16 + 1.17 +public class MockProfileInformationCache extends ProfileInformationCache { 1.18 + public MockProfileInformationCache(String profilePath) { 1.19 + super(profilePath); 1.20 + } 1.21 + 1.22 + public boolean isInitialized() { 1.23 + return this.initialized; 1.24 + } 1.25 + public boolean needsWrite() { 1.26 + return this.needsWrite; 1.27 + } 1.28 + public File getFile() { 1.29 + return this.file; 1.30 + } 1.31 + 1.32 + public void writeJSON(JSONObject toWrite) throws IOException { 1.33 + writeToFile(toWrite); 1.34 + } 1.35 + 1.36 + public JSONObject readJSON() throws FileNotFoundException, JSONException { 1.37 + return readFromFile(); 1.38 + } 1.39 + 1.40 + public void setInitialized(final boolean initialized) { 1.41 + this.initialized = initialized; 1.42 + } 1.43 +}