diff options
author | qsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-02 18:04:59 +0000 |
---|---|---|
committer | qsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-02 18:04:59 +0000 |
commit | 1bc5501a7e8e1d35888ece8b0fe11af8e06ac678 (patch) | |
tree | ae0a959ddc71e15d7ff8ee0a561da877e4662328 /mojo/android/javatests/src | |
parent | d476bfa9ea0986f1395ae6987b2f3092bfd036eb (diff) | |
download | chromium_src-1bc5501a7e8e1d35888ece8b0fe11af8e06ac678.zip chromium_src-1bc5501a7e8e1d35888ece8b0fe11af8e06ac678.tar.gz chromium_src-1bc5501a7e8e1d35888ece8b0fe11af8e06ac678.tar.bz2 |
Generate java bindings for constants.
This CL is the first CL introducing java bindings. It only generates constants.
This is a reland of https://codereview.chromium.org/291903003
TBR=viettrungluu@chromium.org,rmcilroy@chromium.org
Review URL: https://codereview.chromium.org/305963009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/android/javatests/src')
-rw-r--r-- | mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTest.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTest.java new file mode 100644 index 0000000..1c4807b --- /dev/null +++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTest.java @@ -0,0 +1,33 @@ +// 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.mojo.bindings; + +import android.test.suitebuilder.annotation.SmallTest; + +import junit.framework.TestCase; + +import org.chromium.mojo.bindings.test.sample.SampleServiceConstants; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +/** + * Testing generated classes and associated features. + */ +public class BindingsTest extends TestCase { + + /** + * Testing constants are correctly generated. + */ + @SmallTest + public void testConstants() throws NoSuchFieldException, SecurityException { + assertEquals(3, SampleServiceConstants.THREE); + Field threeField = SampleServiceConstants.class.getField("THREE"); + assertEquals(byte.class, threeField.getType()); + assertEquals(Modifier.FINAL, threeField.getModifiers() & Modifier.FINAL); + assertEquals(Modifier.STATIC, threeField.getModifiers() & Modifier.STATIC); + } + +} |