diff options
author | qsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 08:43:37 +0000 |
---|---|---|
committer | qsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 08:43:37 +0000 |
commit | 21075b5dc4f91266175d92b46c004c24bf69f73e (patch) | |
tree | 6dc8c72ca5c5648fed0e76d74c2e77776b4969c5 /mojo/android/javatests | |
parent | c4c9c8cf4af14e6944375330bd12712ce4eb5479 (diff) | |
download | chromium_src-21075b5dc4f91266175d92b46c004c24bf69f73e.zip chromium_src-21075b5dc4f91266175d92b46c004c24bf69f73e.tar.gz chromium_src-21075b5dc4f91266175d92b46c004c24bf69f73e.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 with a custom
DEPS file to fix bot issue.
TBR=viettrungluu@chromium.org,rmcilroy@chromium.org
Review URL: https://codereview.chromium.org/312643003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/android/javatests')
-rw-r--r-- | mojo/android/javatests/DEPS | 4 | ||||
-rw-r--r-- | mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTest.java | 33 |
2 files changed, 37 insertions, 0 deletions
diff --git a/mojo/android/javatests/DEPS b/mojo/android/javatests/DEPS new file mode 100644 index 0000000..78cf465 --- /dev/null +++ b/mojo/android/javatests/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + # out should be allowed by default, but bots are failing on this. + "+out", +] 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); + } + +} |