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

Unified Diff: components/precache/android/javatests/src/org/chromium/components/precache/MockDeviceState.java

Issue 1031003003: precache: Move the java files into //components/precache/android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
Index: components/precache/android/javatests/src/org/chromium/components/precache/MockDeviceState.java
diff --git a/components/precache/android/javatests/src/org/chromium/components/precache/MockDeviceState.java b/components/precache/android/javatests/src/org/chromium/components/precache/MockDeviceState.java
new file mode 100644
index 0000000000000000000000000000000000000000..fd4264083e665c654f00d87546411a704adad6b6
--- /dev/null
+++ b/components/precache/android/javatests/src/org/chromium/components/precache/MockDeviceState.java
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.components.precache;
+
+import android.content.Context;
+
+/**
+ * Mock of the DeviceState class.
+ */
+public class MockDeviceState extends DeviceState {
+ private final int mStickyBatteryStatus;
+ private final boolean mPowerIsConnected;
+ private final boolean mInteractive;
+ private final boolean mWifiIsAvailable;
+
+ public MockDeviceState(int stickyBatteryStatus, boolean powerIsConnected,
+ boolean interactive, boolean wifiIsAvailable) {
+ mStickyBatteryStatus = stickyBatteryStatus;
+ mPowerIsConnected = powerIsConnected;
+ mInteractive = interactive;
+ mWifiIsAvailable = wifiIsAvailable;
+ }
+
+ @Override
+ int getStickyBatteryStatus(Context context) {
+ return mStickyBatteryStatus;
+ }
+
+ @Override
+ public boolean isPowerConnected(Context context) {
+ return mPowerIsConnected;
+ }
+
+ @Override
+ public boolean isInteractive(Context context) {
+ return mInteractive;
+ }
+
+ @Override
+ public boolean isWifiAvailable(Context context) {
+ return mWifiIsAvailable;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698