1package org.robolectric.shadows;
2
3import static org.junit.Assert.assertFalse;
4import static org.junit.Assert.assertTrue;
5import static org.robolectric.Shadows.shadowOf;
6
7import android.webkit.JsResult;
8import org.junit.Test;
9import org.junit.runner.RunWith;
10import org.robolectric.RobolectricTestRunner;
11import org.robolectric.shadow.api.Shadow;
12
13@RunWith(RobolectricTestRunner.class)
14public class ShadowJsResultTest {
15
16  @Test
17  public void shouldRecordCanceled() throws Exception {
18    JsResult jsResult = Shadow.newInstanceOf(JsResult.class);
19
20    assertFalse(shadowOf(jsResult).wasCancelled());
21
22    jsResult.cancel();
23    assertTrue(shadowOf(jsResult).wasCancelled());
24
25  }
26
27}
28