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

Unified Diff: net/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleUrlTest.java

Issue 230443005: Move cronet from //net into //components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to r262794 Created 6 years, 8 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: net/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleUrlTest.java
diff --git a/net/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleUrlTest.java b/net/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleUrlTest.java
deleted file mode 100644
index 0c1870832dc8cd91f8ca627ec235f2a71e9441f1..0000000000000000000000000000000000000000
--- a/net/cronet/android/sample/javatests/src/org/chromium/cronet_sample_apk/CronetSampleUrlTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-// 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.cronet_sample_apk;
-
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.chromium.base.test.util.Feature;
-
-import java.io.File;
-
-/**
- * Example test that just starts the cronet sample.
- */
-public class CronetSampleUrlTest extends CronetSampleTestBase {
- // URL used for base tests.
- private static final String URL = "http://127.0.0.1:8000";
-
- @SmallTest
- @Feature({"Cronet"})
- public void testLoadUrl() throws Exception {
- CronetSampleActivity activity = launchCronetSampleWithUrl(URL);
-
- // Make sure the activity was created as expected.
- assertNotNull(activity);
-
- waitForActiveShellToBeDoneLoading();
-
- // Make sure that the URL is set as expected.
- assertEquals(URL, activity.getUrl());
- assertEquals(200, activity.getHttpStatusCode());
- }
-
- @SmallTest
- @Feature({"Cronet"})
- public void testInvalidUrl() throws Exception {
- CronetSampleActivity activity = launchCronetSampleWithUrl(
- "127.0.0.1:8000");
-
- // Make sure the activity was created as expected.
- assertNotNull(activity);
-
- waitForActiveShellToBeDoneLoading();
-
- // The load should fail.
- assertEquals(0, activity.getHttpStatusCode());
- }
-
- @SmallTest
- @Feature({"Cronet"})
- public void testPostData() throws Exception {
- String[] commandLineArgs = {
- CronetSampleActivity.POST_DATA_KEY, "test" };
- CronetSampleActivity activity =
- launchCronetSampleWithUrlAndCommandLineArgs(URL,
- commandLineArgs);
-
- // Make sure the activity was created as expected.
- assertNotNull(activity);
-
- waitForActiveShellToBeDoneLoading();
-
- // Make sure that the URL is set as expected.
- assertEquals(URL, activity.getUrl());
- assertEquals(200, activity.getHttpStatusCode());
- }
-
- @SmallTest
- @Feature({"Cronet"})
- public void testNetLog() throws Exception {
- CronetSampleActivity activity = launchCronetSampleWithUrl(
- "127.0.0.1:8000");
-
- // Make sure the activity was created as expected.
- assertNotNull(activity);
-
- waitForActiveShellToBeDoneLoading();
- File file = File.createTempFile("cronet", "json");
- activity.mRequestContext.startNetLogToFile(file.getPath());
- activity.startWithURL_UrlRequest(URL);
- Thread.sleep(5000);
- activity.mRequestContext.stopNetLog();
- assertTrue(file.exists());
- assertTrue(file.length() != 0);
- assertTrue(file.delete());
- assertTrue(!file.exists());
- }
-}

Powered by Google App Engine
This is Rietveld 408576698