-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ui tests and dependency bump * Runs UI tests on CircleCI and BuddyBuild * Drops renaming APK, created problems for spoon on CircleCi * Updates depenedencies to newer versions, and ports code if needed * Drops `apt`, uses default `annotationProcessor` instead
- Loading branch information
Showing
26 changed files
with
260 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
app/src/androidTest/java/com/jakewharton/u2020/U2020TestRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.jakewharton.u2020; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.app.KeyguardManager; | ||
import android.content.Context; | ||
import android.os.PowerManager; | ||
import android.support.test.runner.AndroidJUnitRunner; | ||
|
||
import static android.content.Context.KEYGUARD_SERVICE; | ||
import static android.content.Context.POWER_SERVICE; | ||
import static android.os.PowerManager.ACQUIRE_CAUSES_WAKEUP; | ||
import static android.os.PowerManager.FULL_WAKE_LOCK; | ||
import static android.os.PowerManager.ON_AFTER_RELEASE; | ||
|
||
public final class U2020TestRunner extends AndroidJUnitRunner { | ||
private PowerManager.WakeLock wakeLock; | ||
|
||
// Permissions added in debug only manifest. | ||
@Override | ||
@SuppressLint("MissingPermission") | ||
public void onStart() { | ||
Context app = getTargetContext().getApplicationContext(); | ||
|
||
String name = U2020TestRunner.class.getSimpleName(); | ||
// Unlock the device so that the tests can input keystrokes. | ||
KeyguardManager keyguard = (KeyguardManager) app.getSystemService(KEYGUARD_SERVICE); | ||
//noinspection ResourceType | ||
keyguard.newKeyguardLock(name).disableKeyguard(); | ||
// Wake up the screen. | ||
PowerManager power = (PowerManager) app.getSystemService(POWER_SERVICE); | ||
wakeLock = power.newWakeLock(FULL_WAKE_LOCK | ACQUIRE_CAUSES_WAKEUP | ON_AFTER_RELEASE, name); | ||
wakeLock.acquire(); | ||
|
||
super.onStart(); | ||
} | ||
|
||
@Override | ||
@SuppressLint("MissingPermission") | ||
public void onDestroy() { | ||
super.onDestroy(); | ||
wakeLock.release(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.byoutline.kickmaterial"> | ||
|
||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK"/> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.