Search in sources :

Example 1 with CrashReporter

use of com.android.tools.idea.diagnostics.crash.CrashReporter in project android by JetBrains.

the class RenderTaskTest method testCrashReport.

public void testCrashReport() throws Exception {
    VirtualFile layoutFile = myFixture.copyFileToProject("xmlpull/simple.xml", "res/layout/foo.xml");
    Configuration configuration = getConfiguration(layoutFile, DEFAULT_DEVICE_ID);
    RenderLogger logger = mock(RenderLogger.class);
    doThrow(new NullPointerException()).when(logger).warning(eq("resources.resolve.theme"), anyString(), any());
    CrashReporter mockCrashReporter = mock(CrashReporter.class);
    RenderTask task = createRenderTask(layoutFile, configuration, logger);
    task.setCrashReporter(mockCrashReporter);
    task.render();
    verify(mockCrashReporter, times(1)).submit(isNotNull(CrashReport.class));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Configuration(com.android.tools.idea.configurations.Configuration) CrashReport(com.android.tools.idea.diagnostics.crash.CrashReport) CrashReporter(com.android.tools.idea.diagnostics.crash.CrashReporter)

Aggregations

Configuration (com.android.tools.idea.configurations.Configuration)1 CrashReport (com.android.tools.idea.diagnostics.crash.CrashReport)1 CrashReporter (com.android.tools.idea.diagnostics.crash.CrashReporter)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1