OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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.browser.firstrun; |
| 6 |
| 7 import android.test.suitebuilder.annotation.SmallTest; |
| 8 import android.view.KeyEvent; |
| 9 |
| 10 import org.chromium.base.test.util.CommandLineFlags; |
| 11 import org.chromium.base.test.util.Feature; |
| 12 import org.chromium.chrome.browser.ChromeSwitches; |
| 13 import org.chromium.chrome.browser.tabmodel.TabList; |
| 14 import org.chromium.chrome.test.ChromeTabbedActivityTestBase; |
| 15 |
| 16 /** |
| 17 * Integration test suite for the first run experience. |
| 18 */ |
| 19 @CommandLineFlags.Remove(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) |
| 20 public class FirstRunIntegrationTest extends ChromeTabbedActivityTestBase { |
| 21 |
| 22 /** |
| 23 * Exiting the first run experience should close all tabs, |
| 24 * finalize the tab closures and close Chrome. |
| 25 */ |
| 26 @SmallTest |
| 27 @Feature({"FirstRunExperience"}) |
| 28 public void testExitFirstRunExperience() { |
| 29 if (FirstRunStatus.getFirstRunFlowComplete(getActivity())) { |
| 30 return; |
| 31 } |
| 32 |
| 33 sendKeys(KeyEvent.KEYCODE_BACK); |
| 34 getInstrumentation().waitForIdleSync(); |
| 35 |
| 36 assertEquals("Expected no tabs to be present", |
| 37 0, getActivity().getCurrentTabModel().getCount()); |
| 38 TabList fullModel = getActivity().getCurrentTabModel().getComprehensiveM
odel(); |
| 39 assertEquals("Expected no tabs to be present in the comprehensive model"
, |
| 40 0, fullModel.getCount()); |
| 41 assertTrue("Activity was not closed.", |
| 42 getActivity().isFinishing() || getActivity().isDestroyed()); |
| 43 } |
| 44 |
| 45 @Override |
| 46 public void startMainActivity() throws InterruptedException { |
| 47 startMainActivityFromLauncher(); |
| 48 } |
| 49 |
| 50 } |
OLD | NEW |