1 // Copyright 2012 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 /** Tests to verify that NetError.java is created successfully. */ 6 package org.chromium.net; 7 8 import androidx.test.filters.SmallTest; 9 10 import org.junit.Assert; 11 import org.junit.Test; 12 import org.junit.runner.RunWith; 13 14 import org.chromium.base.test.BaseJUnit4ClassRunner; 15 import org.chromium.base.test.util.Batch; 16 import org.chromium.base.test.util.Feature; 17 18 @RunWith(BaseJUnit4ClassRunner.class) 19 @Batch(Batch.UNIT_TESTS) 20 public class NetErrorsTest { 21 // These are manually copied and should be kept in sync with net_error_list.h. 22 private static final int IO_PENDING_ERROR = -1; 23 private static final int FAILED_ERROR = -2; 24 25 /** 26 * Test whether we can include NetError.java and call to static integers defined in the file. 27 * 28 */ 29 @Test 30 @SmallTest 31 @Feature({"Android-AppBase"}) testExampleErrorDefined()32 public void testExampleErrorDefined() { 33 Assert.assertEquals(IO_PENDING_ERROR, NetError.ERR_IO_PENDING); 34 Assert.assertEquals(FAILED_ERROR, NetError.ERR_FAILED); 35 } 36 } 37