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

Unified Diff: components/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java

Issue 1221513002: Update the cronet sample app with new async APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add WritableByteChannel Created 5 years, 5 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/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java
diff --git a/components/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java b/components/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java
index 098431ff845b3b64bd01d333ccb12a1570514307..1c39c75abe57970c6ea021b4b4afb48138fb1d19 100644
--- a/components/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java
+++ b/components/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleTest.java
@@ -52,34 +52,22 @@ public class CronetSampleTest extends
}
/**
- * Starts the CronetSample activity and loads the given URL. The URL can be
- * null, in which case will default to
- * CronetSampleActivity.DEFAULT_SHELL_URL.
+ * Starts the CronetSample activity and loads the given URL.
*/
protected CronetSampleActivity launchCronetSampleWithUrl(String url) {
- return launchCronetSampleWithUrlAndCommandLineArgs(url, null);
- }
-
- /**
- * Starts the CronetSample activity appending the provided command line
- * arguments and loads the given URL. The URL can be null, in which case
- * will default to CronetSampleActivity.DEFAULT_SHELL_URL.
- */
- protected CronetSampleActivity launchCronetSampleWithUrlAndCommandLineArgs(
- String url, String[] commandLineArgs) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- if (url != null)
- intent.setData(Uri.parse(url));
+ intent.setData(Uri.parse(url));
intent.setComponent(new ComponentName(
getInstrumentation().getTargetContext(),
CronetSampleActivity.class));
- if (commandLineArgs != null) {
- intent.putExtra(CronetSampleActivity.COMMAND_LINE_ARGS_KEY,
- commandLineArgs);
- }
setActivityIntent(intent);
+ try {
+ waitForActiveShellToBeDoneLoading();
+ } catch (Throwable e) {
+ fail("Active shell has failed to load.");
+ }
return getActivity();
}

Powered by Google App Engine
This is Rietveld 408576698