Chromium Code Reviews| Index: chrome/android/javatests/src/org/chromium/chrome/test/crash/IntentionalCrashTest.java |
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/test/crash/IntentionalCrashTest.java b/chrome/android/javatests/src/org/chromium/chrome/test/crash/IntentionalCrashTest.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2c3fad3a2f5b1723a12183b1ccfc5aefbcc4453d |
| --- /dev/null |
| +++ b/chrome/android/javatests/src/org/chromium/chrome/test/crash/IntentionalCrashTest.java |
| @@ -0,0 +1,68 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.test.crash; |
| + |
| +import org.junit.Assert; |
| +import org.junit.Rule; |
| +import org.junit.Test; |
| +import org.junit.runner.RunWith; |
| + |
| +import org.chromium.base.test.util.CommandLineFlags; |
| +import org.chromium.base.test.util.DisabledTest; |
| +import org.chromium.chrome.browser.ChromeActivity; |
| +import org.chromium.chrome.test.ChromeActivityTestRule; |
| +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; |
| + |
| +/** Tests that intentionally crash in different ways. |
| + * |
| + * These are all purposefully disabled and should only be run manually. |
| + */ |
| +@RunWith(ChromeJUnit4ClassRunner.class) |
| +@CommandLineFlags.Add("disable-fre") |
|
Ted C
2017/04/27 16:09:45
ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE
jbudorick
2017/04/28 23:00:13
Done.
|
| +public class IntentionalCrashTest { |
| + @Rule |
| + public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = |
| + new ChromeActivityTestRule(ChromeActivity.class); |
| + |
| + @DisabledTest |
| + @Test |
| + public void testRendererCrash() { |
| + try { |
| + mActivityTestRule.startMainActivityWithURL("chrome://crash"); |
| + } catch (InterruptedException e) { |
| + Assert.fail(e.toString()); |
| + } |
| + } |
| + |
| + @DisabledTest |
| + @Test |
| + public void testBrowserCrash() { |
| + try { |
| + mActivityTestRule.startMainActivityWithURL("chrome://inducebrowsercrashforrealz"); |
| + } catch (InterruptedException e) { |
| + Assert.fail(e.toString()); |
| + } |
| + } |
| + |
| + @DisabledTest |
| + @Test |
| + public void testJavaCrash() { |
| + try { |
| + mActivityTestRule.startMainActivityWithURL("chrome://java-crash"); |
| + } catch (InterruptedException e) { |
| + Assert.fail(e.toString()); |
| + } |
| + } |
| + |
| + @DisabledTest |
| + @Test |
| + public void testGpuCrash() { |
| + try { |
| + mActivityTestRule.startMainActivityWithURL("chrome://gpucrash"); |
| + } catch (InterruptedException e) { |
| + Assert.fail(e.toString()); |
| + } |
| + } |
| +} |