Commit cd44405f authored by aurimas's avatar aurimas Committed by Commit bot

Fix Java indentation issues.

Fix indentation issues to allow enabling Checkstyle indentation rule.

BUG=318404

Review URL: https://codereview.chromium.org/662603004

Cr-Commit-Position: refs/heads/master@{#300162}
parent 115ee92a
...@@ -359,7 +359,7 @@ public class ChromiumUrlRequest implements HttpUrlRequest { ...@@ -359,7 +359,7 @@ public class ChromiumUrlRequest implements HttpUrlRequest {
} }
nativeStart(mUrlRequestAdapter); nativeStart(mUrlRequestAdapter);
} }
} }
@Override @Override
...@@ -510,7 +510,7 @@ public class ChromiumUrlRequest implements HttpUrlRequest { ...@@ -510,7 +510,7 @@ public class ChromiumUrlRequest implements HttpUrlRequest {
mContentLength > mContentLengthLimit && mContentLength > mContentLengthLimit &&
mCancelIfContentLengthOverLimit) { mCancelIfContentLengthOverLimit) {
onContentLengthOverLimit(); onContentLengthOverLimit();
return; return;
} }
if (mBufferFullResponse && mContentLength != -1 && if (mBufferFullResponse && mContentLength != -1 &&
......
...@@ -51,45 +51,45 @@ public class MockUrlRequestJobTest extends CronetTestBase { ...@@ -51,45 +51,45 @@ public class MockUrlRequestJobTest extends CronetTestBase {
@Feature({"Cronet"}) @Feature({"Cronet"})
public void testSuccessURLRequest() throws Exception { public void testSuccessURLRequest() throws Exception {
TestHttpUrlRequestListener listener = TestHttpUrlRequestListener listener =
createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_SUCCESS_URL); createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_SUCCESS_URL);
assertEquals(MOCK_CRONET_TEST_SUCCESS_URL, listener.mUrl); assertEquals(MOCK_CRONET_TEST_SUCCESS_URL, listener.mUrl);
assertEquals(200, listener.mHttpStatusCode); assertEquals(200, listener.mHttpStatusCode);
assertEquals("this is a text file\n", assertEquals("this is a text file\n",
new String(listener.mResponseAsBytes)); new String(listener.mResponseAsBytes));
} }
@SmallTest @SmallTest
@Feature({"Cronet"}) @Feature({"Cronet"})
public void testRedirectURLRequest() throws Exception { public void testRedirectURLRequest() throws Exception {
TestHttpUrlRequestListener listener = TestHttpUrlRequestListener listener =
createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_REDIRECT_URL); createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_REDIRECT_URL);
// Currently Cronet does not expose the url after redirect. // Currently Cronet does not expose the url after redirect.
assertEquals(MOCK_CRONET_TEST_REDIRECT_URL, listener.mUrl); assertEquals(MOCK_CRONET_TEST_REDIRECT_URL, listener.mUrl);
assertEquals(200, listener.mHttpStatusCode); assertEquals(200, listener.mHttpStatusCode);
// Expect that the request is redirected to success.txt. // Expect that the request is redirected to success.txt.
assertEquals("this is a text file\n", assertEquals("this is a text file\n",
new String(listener.mResponseAsBytes)); new String(listener.mResponseAsBytes));
} }
@SmallTest @SmallTest
@Feature({"Cronet"}) @Feature({"Cronet"})
public void testNotFoundURLRequest() throws Exception { public void testNotFoundURLRequest() throws Exception {
TestHttpUrlRequestListener listener = TestHttpUrlRequestListener listener =
createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_NOTFOUND_URL); createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_NOTFOUND_URL);
assertEquals(MOCK_CRONET_TEST_NOTFOUND_URL, listener.mUrl); assertEquals(MOCK_CRONET_TEST_NOTFOUND_URL, listener.mUrl);
assertEquals(404, listener.mHttpStatusCode); assertEquals(404, listener.mHttpStatusCode);
assertEquals( assertEquals(
"<!DOCTYPE html>\n<html>\n<head>\n<title>Not found</title>\n" + "<!DOCTYPE html>\n<html>\n<head>\n<title>Not found</title>\n" +
"<p>Test page loaded.</p>\n</head>\n</html>\n", "<p>Test page loaded.</p>\n</head>\n</html>\n",
new String(listener.mResponseAsBytes)); new String(listener.mResponseAsBytes));
} }
@SmallTest @SmallTest
@Feature({"Cronet"}) @Feature({"Cronet"})
public void testFailedURLRequest() throws Exception { public void testFailedURLRequest() throws Exception {
TestHttpUrlRequestListener listener = TestHttpUrlRequestListener listener =
createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_FAILED_URL); createUrlRequestAndWaitForComplete(MOCK_CRONET_TEST_FAILED_URL);
assertEquals(MOCK_CRONET_TEST_FAILED_URL, listener.mUrl); assertEquals(MOCK_CRONET_TEST_FAILED_URL, listener.mUrl);
assertEquals(0, listener.mHttpStatusCode); assertEquals(0, listener.mHttpStatusCode);
} }
......
...@@ -152,7 +152,7 @@ public class CronetTestActivity extends Activity { ...@@ -152,7 +152,7 @@ public class CronetTestActivity extends Activity {
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int read; int read;
while ((read = in.read(buffer)) != -1) { while ((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read); out.write(buffer, 0, read);
} }
in.close(); in.close();
out.flush(); out.flush();
......
...@@ -92,6 +92,7 @@ public final class SessionControlMessages { ...@@ -92,6 +92,7 @@ public final class SessionControlMessages {
this.rawRequestType = rawRequestType; this.rawRequestType = rawRequestType;
} }
@Override
public void write(JsonWriter writer) throws IOException { public void write(JsonWriter writer) throws IOException {
super.write(writer); super.write(writer);
writer.name("rawRequestType"); writer.name("rawRequestType");
...@@ -153,8 +154,8 @@ public final class SessionControlMessages { ...@@ -153,8 +154,8 @@ public final class SessionControlMessages {
switch (getMessageType(ClientMessageType.class, switch (getMessageType(ClientMessageType.class,
rawType, rawType,
ClientMessageType.UNKNOWN_REQUEST)) { ClientMessageType.UNKNOWN_REQUEST)) {
case UNKNOWN_REQUEST: case UNKNOWN_REQUEST:
return new UnknownRequestMessage(rawType); return new UnknownRequestMessage(rawType);
} }
throw new IOException("Invalid message"); throw new IOException("Invalid message");
} }
...@@ -175,10 +176,10 @@ public final class SessionControlMessages { ...@@ -175,10 +176,10 @@ public final class SessionControlMessages {
reader.endObject(); reader.endObject();
switch (getMessageType(ServerMessageType.class, rawType, null)) { switch (getMessageType(ServerMessageType.class, rawType, null)) {
case ICE_EXCHANGE: case ICE_EXCHANGE:
return new IceExchangeMessage(); return new IceExchangeMessage();
case UNKNOWN_RESPONSE: case UNKNOWN_RESPONSE:
return new UnknownResponseMessage(rawRequestType); return new UnknownResponseMessage(rawRequestType);
} }
throw new IOException("Invalid message"); throw new IOException("Invalid message");
} }
......
...@@ -74,7 +74,7 @@ public class DataChannelMock extends AbstractDataChannel { ...@@ -74,7 +74,7 @@ public class DataChannelMock extends AbstractDataChannel {
@Override @Override
public void registerObserver(final Observer observer) { public void registerObserver(final Observer observer) {
mSignalingThread.invoke(new Runnable() { mSignalingThread.invoke(new Runnable() {
@Override @Override
public void run() { public void run() {
Assert.assertNull(mObserver); Assert.assertNull(mObserver);
mObserver = observer; mObserver = observer;
...@@ -86,7 +86,7 @@ public class DataChannelMock extends AbstractDataChannel { ...@@ -86,7 +86,7 @@ public class DataChannelMock extends AbstractDataChannel {
@Override @Override
public void unregisterObserver() { public void unregisterObserver() {
mSignalingThread.invoke(new Runnable() { mSignalingThread.invoke(new Runnable() {
@Override @Override
public void run() { public void run() {
Assert.assertNotNull(mObserver); Assert.assertNotNull(mObserver);
mObserver = null; mObserver = null;
......
...@@ -97,7 +97,7 @@ public class LocalTunnelBridge { ...@@ -97,7 +97,7 @@ public class LocalTunnelBridge {
throws ProtocolError { throws ProtocolError {
if (mLogPackets) { if (mLogPackets) {
Log.d(TAG, "Received server data packet with " Log.d(TAG, "Received server data packet with "
+ Integer.toString(data.length) + " bytes"); + Integer.toString(data.length) + " bytes");
} }
super.onReceivedDataPacket(connectionId, data); super.onReceivedDataPacket(connectionId, data);
} }
......
...@@ -39,7 +39,7 @@ public class TestUtils { ...@@ -39,7 +39,7 @@ public class TestUtils {
executor.shutdown(); executor.shutdown();
return response; return response;
} }
}); });
} }
public static void writeAndShutdown(LocalSocket socket, String data) throws IOException { public static void writeAndShutdown(LocalSocket socket, String data) throws IOException {
......
...@@ -43,7 +43,7 @@ public final class DomDistillerService { ...@@ -43,7 +43,7 @@ public final class DomDistillerService {
private native boolean nativeHasEntry(long nativeDomDistillerServiceAndroid, String entryId); private native boolean nativeHasEntry(long nativeDomDistillerServiceAndroid, String entryId);
private native String nativeGetUrlForEntry( private native String nativeGetUrlForEntry(
long nativeDomDistillerServiceAndroid, String entryId); long nativeDomDistillerServiceAndroid, String entryId);
private static native long nativeGetDistilledPagePrefsPtr( private static native long nativeGetDistilledPagePrefsPtr(
long nativeDomDistillerServiceAndroid); long nativeDomDistillerServiceAndroid);
} }
...@@ -65,7 +65,7 @@ public class GCMListener extends MultiplexingGcmListener.AbstractListener { ...@@ -65,7 +65,7 @@ public class GCMListener extends MultiplexingGcmListener.AbstractListener {
ThreadUtils.runOnUiThread(new Runnable() { ThreadUtils.runOnUiThread(new Runnable() {
@Override public void run() { @Override public void run() {
GCMDriver.onMessageReceived(getApplicationContext(), appId, GCMDriver.onMessageReceived(getApplicationContext(), appId,
intent.getExtras()); intent.getExtras());
} }
}); });
} }
......
...@@ -99,7 +99,7 @@ public class GoogleCloudMessagingV2 { ...@@ -99,7 +99,7 @@ public class GoogleCloudMessagingV2 {
if (err != null) { if (err != null) {
throw new IOException(err); throw new IOException(err);
} else { } else {
throw new IOException(ERROR_SERVICE_NOT_AVAILABLE); throw new IOException(ERROR_SERVICE_NOT_AVAILABLE);
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new IOException(e.getMessage()); throw new IOException(e.getMessage());
...@@ -109,9 +109,7 @@ public class GoogleCloudMessagingV2 { ...@@ -109,9 +109,7 @@ public class GoogleCloudMessagingV2 {
private void internalRegister(Messenger messenger, String subtype, String... senderIds) { private void internalRegister(Messenger messenger, String subtype, String... senderIds) {
Intent intent = new Intent(ACTION_C2DM_REGISTER); Intent intent = new Intent(ACTION_C2DM_REGISTER);
intent.setPackage(GOOGLE_PLAY_SERVICES_PACKAGE); intent.setPackage(GOOGLE_PLAY_SERVICES_PACKAGE);
if (subtype != null) { if (subtype != null) intent.putExtra("subtype", subtype);
intent.putExtra("subtype", subtype);
}
intent.putExtra(EXTRA_MESSENGER, messenger); intent.putExtra(EXTRA_MESSENGER, messenger);
setPackageNameExtra(intent); setPackageNameExtra(intent);
intent.putExtra(EXTRA_SENDER, getFlatSenderIds(senderIds)); intent.putExtra(EXTRA_SENDER, getFlatSenderIds(senderIds));
...@@ -195,7 +193,7 @@ public class GoogleCloudMessagingV2 { ...@@ -195,7 +193,7 @@ public class GoogleCloudMessagingV2 {
Intent intent = new Intent(ACTION_C2DM_UNREGISTER); Intent intent = new Intent(ACTION_C2DM_UNREGISTER);
intent.setPackage(GOOGLE_PLAY_SERVICES_PACKAGE); intent.setPackage(GOOGLE_PLAY_SERVICES_PACKAGE);
if (subtype != null) { if (subtype != null) {
intent.putExtra("subtype", subtype); intent.putExtra("subtype", subtype);
} }
intent.putExtra(EXTRA_MESSENGER, messenger); intent.putExtra(EXTRA_MESSENGER, messenger);
setPackageNameExtra(intent); setPackageNameExtra(intent);
......
...@@ -455,7 +455,7 @@ public class InvalidationClientService extends AndroidListener { ...@@ -455,7 +455,7 @@ public class InvalidationClientService extends AndroidListener {
void requestSyncFromContentResolver( void requestSyncFromContentResolver(
Bundle bundle, Account account, String contractAuthority) { Bundle bundle, Account account, String contractAuthority) {
Log.d(TAG, "Request sync: " + account + " / " + contractAuthority + " / " Log.d(TAG, "Request sync: " + account + " / " + contractAuthority + " / "
+ bundle.keySet()); + bundle.keySet());
ContentResolver.requestSync(account, contractAuthority, bundle); ContentResolver.requestSync(account, contractAuthority, bundle);
} }
......
...@@ -613,7 +613,7 @@ public class InvalidationClientServiceTest extends ...@@ -613,7 +613,7 @@ public class InvalidationClientServiceTest extends
objectIds.add(ObjectId.newInstance(1, "obj1".getBytes())); objectIds.add(ObjectId.newInstance(1, "obj1".getBytes()));
objectIds.add(ObjectId.newInstance(2, "obj2".getBytes())); objectIds.add(ObjectId.newInstance(2, "obj2".getBytes()));
Intent registrationIntent = Intent registrationIntent =
createRegisterIntent(account, new int[] {1, 2}, new String[] {"obj1", "obj2"}); createRegisterIntent(account, new int[] {1, 2}, new String[] {"obj1", "obj2"});
getService().onHandleIntent(registrationIntent); getService().onHandleIntent(registrationIntent);
assertTrue(expectedObjectIdsRegistered(types, objectIds, false /* isReady */)); assertTrue(expectedObjectIdsRegistered(types, objectIds, false /* isReady */));
......
...@@ -25,11 +25,11 @@ public class ColorChooserAndroid { ...@@ -25,11 +25,11 @@ public class ColorChooserAndroid {
private ColorChooserAndroid(long nativeColorChooserAndroid, private ColorChooserAndroid(long nativeColorChooserAndroid,
Context context, int initialColor, ColorSuggestion[] suggestions) { Context context, int initialColor, ColorSuggestion[] suggestions) {
OnColorChangedListener listener = new OnColorChangedListener() { OnColorChangedListener listener = new OnColorChangedListener() {
@Override @Override
public void onColorChanged(int color) { public void onColorChanged(int color) {
mDialog.dismiss(); mDialog.dismiss();
nativeOnColorChosen(mNativeColorChooserAndroid, color); nativeOnColorChosen(mNativeColorChooserAndroid, color);
} }
}; };
mNativeColorChooserAndroid = nativeColorChooserAndroid; mNativeColorChooserAndroid = nativeColorChooserAndroid;
...@@ -52,7 +52,7 @@ public class ColorChooserAndroid { ...@@ -52,7 +52,7 @@ public class ColorChooserAndroid {
int initialColor, int initialColor,
ColorSuggestion[] suggestions) { ColorSuggestion[] suggestions) {
ColorChooserAndroid chooser = new ColorChooserAndroid(nativeColorChooserAndroid, ColorChooserAndroid chooser = new ColorChooserAndroid(nativeColorChooserAndroid,
contentViewCore.getContext(), initialColor, suggestions); contentViewCore.getContext(), initialColor, suggestions);
chooser.openColorChooser(); chooser.openColorChooser();
return chooser; return chooser;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment