summaryrefslogtreecommitdiffstats
path: root/net/android/javatests/src/org
diff options
context:
space:
mode:
authoryusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-10 19:22:50 +0000
committeryusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-10 19:22:50 +0000
commit2fa3091a0aff683c4d0ab4f0bde847d85b9f4d14 (patch)
tree5ef5daa199cedcd364e80df5537b658dd0c19448 /net/android/javatests/src/org
parent2a8cd6d6b852a18ae7e7f5d7012ad4b6eacdae8b (diff)
downloadchromium_src-2fa3091a0aff683c4d0ab4f0bde847d85b9f4d14.zip
chromium_src-2fa3091a0aff683c4d0ab4f0bde847d85b9f4d14.tar.gz
chromium_src-2fa3091a0aff683c4d0ab4f0bde847d85b9f4d14.tar.bz2
Build NetError.java to use in java side tests by preprocessing net_errors.cc
Java side tests will be using a map to convert these error codes to platform specific ones. This generates a java file which can be used to refer to the errorcode. The included test just does a trivial check whether the java file can be included and used. BUG=137967 Review URL: https://chromiumcodereview.appspot.com/10912136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/android/javatests/src/org')
-rw-r--r--net/android/javatests/src/org/chromium/net/NetErrorsTest.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/android/javatests/src/org/chromium/net/NetErrorsTest.java b/net/android/javatests/src/org/chromium/net/NetErrorsTest.java
new file mode 100644
index 0000000..266655c
--- /dev/null
+++ b/net/android/javatests/src/org/chromium/net/NetErrorsTest.java
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 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.
+
+/**
+ * Tests to verify that NetError.java is created succesfully.
+ */
+
+package org.chromium.net;
+
+import android.test.InstrumentationTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.chromium.net.NetError;
+
+import org.chromium.base.test.Feature;
+
+public class NetErrorsTest extends InstrumentationTestCase {
+ // These are manually copied and should be kept in sync with net_error_list.h.
+ private static int IO_PENDING_ERROR = -1;
+ private static int FAILED_ERROR = -2;
+
+ /**
+ * Test whether we can include NetError.java and call to static integers defined in the file.
+ *
+ * @throws Exception
+ */
+ @SmallTest
+ @Feature({"Android-AppBase"})
+ public void testExampleErrorDefined() throws Exception {
+ assertEquals(IO_PENDING_ERROR, NetError.ERR_IO_PENDING);
+ assertEquals(FAILED_ERROR, NetError.ERR_FAILED);
+ }
+} \ No newline at end of file