| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.android_webview.test; | 5 package org.chromium.android_webview.test; |
| 6 | 6 |
| 7 import android.support.test.filters.SmallTest; | 7 import android.support.test.filters.SmallTest; |
| 8 | 8 |
| 9 import org.chromium.android_webview.AwDebug; | 9 import org.chromium.android_webview.AwDebug; |
| 10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
| 11 import org.chromium.base.test.util.parameter.ParameterizedTest; | 11 import org.chromium.base.test.util.parameter.SkipParameterization; |
| 12 | 12 |
| 13 import java.io.File; | 13 import java.io.File; |
| 14 import java.io.FileInputStream; | 14 import java.io.FileInputStream; |
| 15 import java.io.IOException; | 15 import java.io.IOException; |
| 16 import java.util.Scanner; | 16 import java.util.Scanner; |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * A test suite for AwDebug class. | 19 * A test suite for AwDebug class. |
| 20 */ | 20 */ |
| 21 // Only works in single-process mode, crbug.com/568825. | 21 // Only works in single-process mode, crbug.com/568825. |
| 22 @ParameterizedTest.Set | 22 @SkipParameterization |
| 23 public class AwDebugTest extends AwTestBase { | 23 public class AwDebugTest extends AwTestBase { |
| 24 private static final String TAG = "cr_AwDebugTest"; | 24 private static final String TAG = "cr_AwDebugTest"; |
| 25 private static final String WHITELISTED_DEBUG_KEY = "AW_WHITELISTED_DEBUG_KE
Y"; | 25 private static final String WHITELISTED_DEBUG_KEY = "AW_WHITELISTED_DEBUG_KE
Y"; |
| 26 private static final String NON_WHITELISTED_DEBUG_KEY = "AW_NONWHITELISTED_D
EBUG_KEY"; | 26 private static final String NON_WHITELISTED_DEBUG_KEY = "AW_NONWHITELISTED_D
EBUG_KEY"; |
| 27 private static final String DEBUG_VALUE = "AW_DEBUG_VALUE"; | 27 private static final String DEBUG_VALUE = "AW_DEBUG_VALUE"; |
| 28 | 28 |
| 29 @SmallTest | 29 @SmallTest |
| 30 @Feature({"AndroidWebView", "Debug"}) | 30 @Feature({"AndroidWebView", "Debug"}) |
| 31 public void testDump() throws Throwable { | 31 public void testDump() throws Throwable { |
| 32 File f = File.createTempFile("dump", ".dmp"); | 32 File f = File.createTempFile("dump", ".dmp"); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 FileInputStream fileInputStream = new FileInputStream(file); | 102 FileInputStream fileInputStream = new FileInputStream(file); |
| 103 try { | 103 try { |
| 104 byte[] data = new byte[(int) file.length()]; | 104 byte[] data = new byte[(int) file.length()]; |
| 105 fileInputStream.read(data); | 105 fileInputStream.read(data); |
| 106 return new String(data); | 106 return new String(data); |
| 107 } finally { | 107 } finally { |
| 108 fileInputStream.close(); | 108 fileInputStream.close(); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 } | 111 } |
| OLD | NEW |