Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: content/public/android/junit/src/org/chromium/base/LogTest.java

Issue 1048153002: Add an utility class to improve java logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add overrides of the log functions to allow proguard to properly remove arguments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.base;
Yaron 2015/04/01 20:47:31 This should be in a base/ folder if it's package b
dgn 2015/04/02 12:47:20 It's a unit test, no apk required to run it. I can
Yaron 2015/04/02 14:29:47 Ok, sounds good
6
7 import static org.junit.Assert.assertFalse;
8
9 import org.chromium.testing.local.LocalRobolectricTestRunner;
10 import org.junit.Test;
11 import org.junit.runner.RunWith;
12 import org.robolectric.annotation.Config;
13
14 @RunWith(LocalRobolectricTestRunner.class)
15 @Config(manifest = Config.NONE)
16 public class LogTest {
17 @Test(expected = IllegalArgumentException.class)
18 public void tooLongTagExceptionTest() {
19 new Log("OneCharTooLong!");
20 }
21
22 @Test
23 public void allowedTagsNoExceptionTest() {
24 // See android.util.Log#isLoggable(String, int)}'s doc.
25 final int maxAllowedTagLength = 23;
26 assertFalse(new Log(null).mTag.length() > maxAllowedTagLength);
27 assertFalse(new Log("").mTag.length() > maxAllowedTagLength);
28 assertFalse(new Log("Foo").mTag.length() > maxAllowedTagLength);
29 assertFalse(new Log("LongestAllowed").mTag.length() > maxAllowedTagLengt h);
30 }
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698