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