Ejemplo n.º 1
0
 public void changeOrientation() {
   Display display =
       ((WindowManager) getInstrumentation().getContext().getSystemService(WINDOW_SERVICE))
           .getDefaultDisplay();
   int angle = display.getRotation();
   int newAngle =
       ((angle == ROTATION_0) || (angle == ROTATION_180)) ? Solo.LANDSCAPE : Solo.PORTRAIT;
   solo.setActivityOrientation(newAngle);
 }
Ejemplo n.º 2
0
  public void afterRestart() {
    solo.setActivityOrientation(Solo.PORTRAIT);
    solo.sleep(SLEEP_AFTER_RESTART);
    waitOnThrobber();
    if (PRECRAWLING.length > 0) {
      refreshCurrentActivity();
      retrieveWidgets();
      processPrecrawling();
    }

    Log.d("nofatclips", "Ready to operate after restarting...");
  }
Ejemplo n.º 3
0
  public void testRotation() {
    Podcast p = insertPodcast();

    solo.setActivityOrientation(Solo.LANDSCAPE);
    while (solo.scrollDown()) ;

    assertTrue(
        String.format("New podcast %s should be displayed in list", uuid), solo.searchText(uuid));
    assertTrue(
        String.format("New podcast %s should be in DAO", uuid),
        dao.getPodcastById(p.getId()) != null);
  }
 public void testAddCourseScreenOriantationChange() {
   ListView listView;
   solo.clickOnView(getActivity().findViewById(R.id.add));
   solo.enterText(0, "Course");
   solo.clickOnEditText(0);
   solo.sendKey(Solo.ENTER);
   solo.waitForText("THE COURSE #2", 1, 5);
   listView = (ListView) solo.getView(android.R.id.list);
   assertEquals("List view should contain 2 items before doing anything", 2, listView.getCount());
   solo.setActivityOrientation(Solo.LANDSCAPE);
   solo.sleep(500);
   listView = (ListView) solo.getView(android.R.id.list);
   solo.sleep(3000);
   assertEquals("List view should't change size after oriantation change", 2, listView.getCount());
   assertEquals(
       "SearchView should not reset.", "Course", solo.getEditText(0).getText().toString());
   solo.goBack();
   solo.goBack();
 }