Commit 38a3c2ce authored by Lucas Garron's avatar Lucas Garron Committed by Commit Bot

Add ConnectionInfoPopupTest and PageInfoPopupTest classes on Android.

Right now, these just test that ConnectionInfoPopupTest.show() and
PageInfoPopupTest.show() can be invoked without crashing.

Bug: 657299
Change-Id: Ic075b86e7d12df9893173bb35692ecc8b7e3df6d
Reviewed-on: https://chromium-review.googlesource.com/557450
Commit-Queue: Lucas Garron <lgarron@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485511}
parent 449b5c27
...@@ -1515,6 +1515,8 @@ chrome_test_java_sources = [ ...@@ -1515,6 +1515,8 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/UrlBarTest.java",
"javatests/src/org/chromium/chrome/browser/omnibox/VoiceSuggestionProviderTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/VoiceSuggestionProviderTest.java",
"javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java",
"javatests/src/org/chromium/chrome/browser/page_info/ConnectionInfoPopupTest.java",
"javatests/src/org/chromium/chrome/browser/page_info/PageInfoPopupTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationIntegrationTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationIntegrationTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationUnitTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationUnitTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableBookmarksEditingUnitTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableBookmarksEditingUnitTest.java",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.page_info;
import android.support.test.filters.MediumTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
/**
* Tests for ConnectionInfoPopup.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class ConnectionInfoPopupTest {
@Rule
public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
new ChromeActivityTestRule<>(ChromeActivity.class);
/**
* Tests that ConnectionInfoPopup can be instantiated and shown.
*/
@Test
@MediumTest
@Feature({"ConnectionInfoPopup"})
@RetryOnFailure
public void testShow() throws InterruptedException {
mActivityTestRule.startMainActivityOnBlankPage();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
ConnectionInfoPopup.show(mActivityTestRule.getActivity(),
mActivityTestRule.getActivity().getActivityTab().getWebContents());
}
});
}
}
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.page_info;
import android.support.test.filters.MediumTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
/**
* Tests for PageInfoPopup.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class PageInfoPopupTest {
@Rule
public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
new ChromeActivityTestRule<>(ChromeActivity.class);
/**
* Tests that PageInfoPopup can be instantiated and shown.
*/
@Test
@MediumTest
@Feature({"PageInfoPopup"})
@RetryOnFailure
public void testShow() throws InterruptedException {
mActivityTestRule.startMainActivityOnBlankPage();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
PageInfoPopup.show(mActivityTestRule.getActivity(),
mActivityTestRule.getActivity().getActivityTab(), null,
PageInfoPopup.OPENED_FROM_MENU);
}
});
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment