Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/permissions/GeolocationTest.java

Issue 2583933003: Replace deprecated Android java test annotations (Closed)
Patch Set: Rebase again :( Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.permissions; 5 package org.chromium.chrome.browser.permissions;
6 6
7 import android.test.suitebuilder.annotation.LargeTest; 7 import android.support.test.filters.LargeTest;
8 import android.test.suitebuilder.annotation.MediumTest; 8 import android.support.test.filters.MediumTest;
9 import android.test.suitebuilder.annotation.Smoke;
10 9
11 import org.chromium.base.test.util.CommandLineFlags; 10 import org.chromium.base.test.util.CommandLineFlags;
12 import org.chromium.base.test.util.Feature; 11 import org.chromium.base.test.util.Feature;
13 import org.chromium.base.test.util.RetryOnFailure; 12 import org.chromium.base.test.util.RetryOnFailure;
14 import org.chromium.chrome.browser.tab.Tab; 13 import org.chromium.chrome.browser.tab.Tab;
15 import org.chromium.chrome.test.util.browser.LocationSettingsTestUtil; 14 import org.chromium.chrome.test.util.browser.LocationSettingsTestUtil;
16 import org.chromium.device.geolocation.LocationProviderFactory; 15 import org.chromium.device.geolocation.LocationProviderFactory;
17 import org.chromium.device.geolocation.MockLocationProvider; 16 import org.chromium.device.geolocation.MockLocationProvider;
18 17
19 /** 18 /**
(...skipping 27 matching lines...) Expand all
47 tab.addObserver(updateWaiter); 46 tab.addObserver(updateWaiter);
48 runAllowTest(updateWaiter, TEST_FILE, javascript, nUpdates, withGesture, isDialog, 47 runAllowTest(updateWaiter, TEST_FILE, javascript, nUpdates, withGesture, isDialog,
49 hasSwitch, toggleSwitch); 48 hasSwitch, toggleSwitch);
50 tab.removeObserver(updateWaiter); 49 tab.removeObserver(updateWaiter);
51 } 50 }
52 51
53 /** 52 /**
54 * Verify Geolocation creates an InfoBar and receives a mock location. 53 * Verify Geolocation creates an InfoBar and receives a mock location.
55 * @throws Exception 54 * @throws Exception
56 */ 55 */
57 @Smoke
58 @MediumTest 56 @MediumTest
59 @CommandLineFlags.Add("disable-features=" + MODAL_FLAG) 57 @CommandLineFlags.Add("disable-features=" + MODAL_FLAG)
60 @Feature({"Location", "Main"}) 58 @Feature({"Location", "Main"})
61 public void testGeolocationPlumbingAllowedInfoBar() throws Exception { 59 public void testGeolocationPlumbingAllowedInfoBar() throws Exception {
62 runTest("initiate_getCurrentPosition()", 1, false, false, false, false); 60 runTest("initiate_getCurrentPosition()", 1, false, false, false, false);
63 } 61 }
64 62
65 /** 63 /**
66 * Verify Geolocation creates a dialog and receives a mock location. 64 * Verify Geolocation creates a dialog and receives a mock location.
67 * @throws Exception 65 * @throws Exception
68 */ 66 */
69 @Smoke
70 @MediumTest 67 @MediumTest
71 @CommandLineFlags.Add("enable-features=" + MODAL_FLAG) 68 @CommandLineFlags.Add("enable-features=" + MODAL_FLAG)
72 @Feature({"Location", "Main"}) 69 @Feature({"Location", "Main"})
73 public void testGeolocationPlumbingAllowedDialog() throws Exception { 70 public void testGeolocationPlumbingAllowedDialog() throws Exception {
74 runTest("initiate_getCurrentPosition()", 1, true, true, false, false); 71 runTest("initiate_getCurrentPosition()", 1, true, true, false, false);
75 } 72 }
76 73
77 /** 74 /**
78 * Verify Geolocation creates a dialog and receives a mock location when dia logs are explicitly 75 * Verify Geolocation creates a dialog and receives a mock location when dia logs are explicitly
79 * enabled and permitted to trigger without a gesture. 76 * enabled and permitted to trigger without a gesture.
80 * @throws Exception 77 * @throws Exception
81 */ 78 */
82 @Smoke
83 @MediumTest 79 @MediumTest
84 @CommandLineFlags.Add({NO_GESTURE_FEATURE, FORCE_FIELDTRIAL, FORCE_FIELDTRIA L_PARAMS}) 80 @CommandLineFlags.Add({NO_GESTURE_FEATURE, FORCE_FIELDTRIAL, FORCE_FIELDTRIA L_PARAMS})
85 @Feature({"Location", "Main"}) 81 @Feature({"Location", "Main"})
86 public void testGeolocationPlumbingAllowedDialogNoGesture() throws Exception { 82 public void testGeolocationPlumbingAllowedDialogNoGesture() throws Exception {
87 runTest("initiate_getCurrentPosition()", 1, false, true, false, false); 83 runTest("initiate_getCurrentPosition()", 1, false, true, false, false);
88 } 84 }
89 85
90 /** 86 /**
91 * Verify Geolocation shows an infobar and receives a mock location if the m odal flag is on but 87 * Verify Geolocation shows an infobar and receives a mock location if the m odal flag is on but
92 * no user gesture is specified. 88 * no user gesture is specified.
93 * @throws Exception 89 * @throws Exception
94 */ 90 */
95 @Smoke
96 @MediumTest 91 @MediumTest
97 @CommandLineFlags.Add("enable-features=" + MODAL_FLAG) 92 @CommandLineFlags.Add("enable-features=" + MODAL_FLAG)
98 @Feature({"Location", "Main"}) 93 @Feature({"Location", "Main"})
99 public void testGeolocationPlumbingAllowedNoGestureShowsInfoBar() throws Exc eption { 94 public void testGeolocationPlumbingAllowedNoGestureShowsInfoBar() throws Exc eption {
100 runTest("initiate_getCurrentPosition()", 1, false, false, false, false); 95 runTest("initiate_getCurrentPosition()", 1, false, false, false, false);
101 } 96 }
102 97
103 /** 98 /**
104 * Verify Geolocation creates an InfoBar and receives multiple locations. 99 * Verify Geolocation creates an InfoBar and receives multiple locations.
105 * @throws Exception 100 * @throws Exception
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 * that feature is enabled. Use a dialog. 212 * that feature is enabled. Use a dialog.
218 * @throws Exception 213 * @throws Exception
219 */ 214 */
220 @LargeTest 215 @LargeTest
221 @CommandLineFlags.Add("enable-features=" + MODAL_TOGGLE_FLAG) 216 @CommandLineFlags.Add("enable-features=" + MODAL_TOGGLE_FLAG)
222 @Feature({"Location"}) 217 @Feature({"Location"})
223 public void testGeolocationWatchPersistenceOffAllowedDialog() throws Excepti on { 218 public void testGeolocationWatchPersistenceOffAllowedDialog() throws Excepti on {
224 runTest("initiate_watchPosition()", 2, true, true, true, true); 219 runTest("initiate_watchPosition()", 2, true, true, true, true);
225 } 220 }
226 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698