OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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.chrome.test.crash; |
| 6 |
| 7 import org.junit.Assert; |
| 8 import org.junit.Rule; |
| 9 import org.junit.Test; |
| 10 import org.junit.runner.RunWith; |
| 11 |
| 12 import org.chromium.base.test.util.CommandLineFlags; |
| 13 import org.chromium.base.test.util.DisabledTest; |
| 14 import org.chromium.chrome.browser.ChromeActivity; |
| 15 import org.chromium.chrome.browser.ChromeSwitches; |
| 16 import org.chromium.chrome.test.ChromeActivityTestRule; |
| 17 import org.chromium.chrome.test.ChromeJUnit4ClassRunner; |
| 18 |
| 19 /** Tests that intentionally crash in different ways. |
| 20 * |
| 21 * These are all purposefully disabled and should only be run manually. |
| 22 */ |
| 23 @RunWith(ChromeJUnit4ClassRunner.class) |
| 24 @CommandLineFlags.Add(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) |
| 25 public class IntentionalCrashTest { |
| 26 @Rule |
| 27 public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = |
| 28 new ChromeActivityTestRule(ChromeActivity.class); |
| 29 |
| 30 @DisabledTest |
| 31 @Test |
| 32 public void testRendererCrash() { |
| 33 try { |
| 34 mActivityTestRule.startMainActivityWithURL("chrome://crash"); |
| 35 } catch (InterruptedException e) { |
| 36 Assert.fail(e.toString()); |
| 37 } |
| 38 } |
| 39 |
| 40 @DisabledTest |
| 41 @Test |
| 42 public void testBrowserCrash() { |
| 43 try { |
| 44 mActivityTestRule.startMainActivityWithURL("chrome://inducebrowsercr
ashforrealz"); |
| 45 } catch (InterruptedException e) { |
| 46 Assert.fail(e.toString()); |
| 47 } |
| 48 } |
| 49 |
| 50 @DisabledTest |
| 51 @Test |
| 52 public void testJavaCrash() { |
| 53 try { |
| 54 mActivityTestRule.startMainActivityWithURL("chrome://java-crash"); |
| 55 } catch (InterruptedException e) { |
| 56 Assert.fail(e.toString()); |
| 57 } |
| 58 } |
| 59 |
| 60 @DisabledTest |
| 61 @Test |
| 62 public void testGpuCrash() { |
| 63 try { |
| 64 mActivityTestRule.startMainActivityWithURL("chrome://gpucrash"); |
| 65 } catch (InterruptedException e) { |
| 66 Assert.fail(e.toString()); |
| 67 } |
| 68 } |
| 69 } |
OLD | NEW |