mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Format Java code in xplat/js/react-native-github
Summary: This diff formats the Java class files inside xplat/js/react-native-github. Since google-java-format was enabled in D16071401 we want to codemode the existing code so that users don't have to deal with formatter lint noise at diff-time. ```arc f --paths-cmd 'hg files -I "**/*.java"'``` drop-conflicts Reviewed By: cpojer Differential Revision: D16071725 fbshipit-source-id: fc6e3852e45742c109f0c5ac4065d64201c74204
This commit is contained in:
committed by
Facebook Github Bot
parent
61e95e5cbf
commit
6c0f73b322
@@ -1,23 +1,20 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
||||
* directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.tests;
|
||||
|
||||
import android.view.View;
|
||||
import com.facebook.react.testing.ReactAppInstrumentationTestCase;
|
||||
import com.facebook.react.uimanager.util.ReactFindViewUtil;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.facebook.react.testing.ReactAppInstrumentationTestCase;
|
||||
import com.facebook.react.uimanager.util.ReactFindViewUtil;
|
||||
|
||||
/**
|
||||
* Tests that the 'nativeID' property can be set on various views.
|
||||
* The 'nativeID' property is used to reference react managed views from native code.
|
||||
* Tests that the 'nativeID' property can be set on various views. The 'nativeID' property is used
|
||||
* to reference react managed views from native code.
|
||||
*/
|
||||
public class NativeIdTestCase extends ReactAppInstrumentationTestCase {
|
||||
|
||||
@@ -26,43 +23,43 @@ public class NativeIdTestCase extends ReactAppInstrumentationTestCase {
|
||||
return "NativeIdTestApp";
|
||||
}
|
||||
|
||||
private final List<String> viewTags = Arrays.asList(
|
||||
"Image",
|
||||
"Text",
|
||||
"TouchableBounce",
|
||||
"TouchableHighlight",
|
||||
"TouchableOpacity",
|
||||
"TouchableWithoutFeedback",
|
||||
"TextInput",
|
||||
"View");
|
||||
private final List<String> viewTags =
|
||||
Arrays.asList(
|
||||
"Image",
|
||||
"Text",
|
||||
"TouchableBounce",
|
||||
"TouchableHighlight",
|
||||
"TouchableOpacity",
|
||||
"TouchableWithoutFeedback",
|
||||
"TextInput",
|
||||
"View");
|
||||
|
||||
private boolean mViewFound;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
mViewFound = false;
|
||||
ReactFindViewUtil.addViewListener(new ReactFindViewUtil.OnViewFoundListener() {
|
||||
@Override
|
||||
public String getNativeId() {
|
||||
return viewTags.get(0);
|
||||
}
|
||||
ReactFindViewUtil.addViewListener(
|
||||
new ReactFindViewUtil.OnViewFoundListener() {
|
||||
@Override
|
||||
public String getNativeId() {
|
||||
return viewTags.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewFound(View view) {
|
||||
mViewFound = true;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onViewFound(View view) {
|
||||
mViewFound = true;
|
||||
}
|
||||
});
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
public void testPropertyIsSetForViews() {
|
||||
for (String nativeId : viewTags) {
|
||||
View viewWithTag = ReactFindViewUtil.findView(
|
||||
getActivity().getRootView(),
|
||||
nativeId);
|
||||
View viewWithTag = ReactFindViewUtil.findView(getActivity().getRootView(), nativeId);
|
||||
assertNotNull(
|
||||
"View with nativeID " + nativeId + " was not found. Check NativeIdTestModule.js.",
|
||||
viewWithTag);
|
||||
"View with nativeID " + nativeId + " was not found. Check NativeIdTestModule.js.",
|
||||
viewWithTag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,20 +70,19 @@ public class NativeIdTestCase extends ReactAppInstrumentationTestCase {
|
||||
public void testFindView() {
|
||||
mViewFound = false;
|
||||
ReactFindViewUtil.findView(
|
||||
getActivity().getRootView(),
|
||||
new ReactFindViewUtil.OnViewFoundListener() {
|
||||
@Override
|
||||
public String getNativeId() {
|
||||
return viewTags.get(0);
|
||||
}
|
||||
getActivity().getRootView(),
|
||||
new ReactFindViewUtil.OnViewFoundListener() {
|
||||
@Override
|
||||
public String getNativeId() {
|
||||
return viewTags.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewFound(View view) {
|
||||
mViewFound = true;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onViewFound(View view) {
|
||||
mViewFound = true;
|
||||
}
|
||||
});
|
||||
assertTrue(
|
||||
"OnViewFound callback should have successfully been invoked synchronously",
|
||||
mViewFound);
|
||||
"OnViewFound callback should have successfully been invoked synchronously", mViewFound);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user