Bug 1184094 - testRestrictions: No restrictions should be enforced when using a normal profile. r=margaret
authorSebastian Kaspari <s.kaspari@gmail.com>
Fri, 31 Jul 2015 09:49:04 +0200
changeset 255620 06ea5f2003a2484690df9a935050d23e1f32f4f7
parent 255619 2c9eadcc613aa5216226813cb22403a26126df90
child 255621 f43ef293278b40468216335575a8b230f55102be
push id29150
push userryanvm@gmail.com
push dateFri, 31 Jul 2015 19:03:30 +0000
treeherdermozilla-central@afa67b6957bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1184094
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1184094 - testRestrictions: No restrictions should be enforced when using a normal profile. r=margaret
mobile/android/tests/browser/robocop/robocop.ini
mobile/android/tests/browser/robocop/testRestrictions.java
--- a/mobile/android/tests/browser/robocop/robocop.ini
+++ b/mobile/android/tests/browser/robocop/robocop.ini
@@ -133,16 +133,17 @@ skip-if = android_version == "18"
 [testOrderedBroadcast.java]
 [testOSLocale.java]
 # disabled on 2.3 and 4.3: Bug 1124494
 skip-if = android_version == "10" || android_version == "18"
 [testReaderView.java]
 [testReadingListCache.java]
 [testResourceSubstitutions.java]
 [testRestrictedProfiles.java]
+[testRestrictions.java]
 [testSessionFormData.java]
 [testSharedPreferences.java]
 [testSimpleDiscovery.java]
 [testTrackingProtection.java]
 # disabled on 4.3, bug 1158363
 skip-if = android_version == "18"
 [testUITelemetry.java]
 [testVideoControls.java]
new file mode 100644
--- /dev/null
+++ b/mobile/android/tests/browser/robocop/testRestrictions.java
@@ -0,0 +1,24 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.gecko.tests;
+
+import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertTrue;
+
+import org.mozilla.gecko.RestrictedProfiles;
+import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.tests.helpers.GeckoHelper;
+
+public class testRestrictions extends UITest {
+    public void testRestrictions() {
+        GeckoHelper.blockForReady();
+
+        // No restrictions should be enforced when using a normal profile
+        for (Restriction restriction : Restriction.values()) {
+            fAssertTrue(String.format("Restriction %s is not enforced", restriction.name),
+                RestrictedProfiles.isAllowed(getActivity(), restriction)
+            );
+        }
+    }
+}