Bug 1500155 - Part 6 - address review comments r=esawin,snorp. Update changelog.
☠☠ backed out by f7c35130959c ☠ ☠
authorEmily Toop <etoop@mozilla.com>
Wed, 12 Dec 2018 13:18:52 +0000
changeset 450252 c4bc2e839a9e28b83802caf99d2ecf5eddd14e65
parent 450251 4dd0b1c3524cafe7cfe7ba5d10105324b4906895
child 450253 85900c298b050ff0191954eacb92e4a4f11c741c
push id74573
push useretoop@mozilla.com
push dateWed, 12 Dec 2018 13:20:44 +0000
treeherderautoland@0f66513c5f23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin, snorp
bugs1500155
milestone66.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 1500155 - Part 6 - address review comments r=esawin,snorp. Update changelog. Differential Revision: https://phabricator.services.mozilla.com/D13421
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/SessionLifecycleTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/RemoteGeckoService.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/SessionLifecycleTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/SessionLifecycleTest.kt
@@ -72,21 +72,16 @@ class SessionLifecycleTest : BaseSession
     }
 
     @Test(expected = IllegalStateException::class)
     fun open_throwOnAlreadyOpen() {
         // Throw exception if retrying to open again; otherwise we would leak the old open window.
         sessionRule.session.open()
     }
 
-    @Test(expected = IllegalStateException::class)
-    fun setChromeURI_throwOnOpenSession() {
-        GeckoSessionSettings.Builder(sessionRule.session.settings).chromeUri("chrome://invalid/path/to.xul")
-    }
-
     @Test fun readFromParcel() {
         val session = sessionRule.createOpenSession()
 
         session.toParcel { parcel ->
             val newSession = sessionRule.createClosedSession()
             newSession.readFromParcel(parcel)
 
             assertThat("New session has same settings",
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/RemoteGeckoService.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/crash/RemoteGeckoService.kt
@@ -26,17 +26,19 @@ class RemoteGeckoService : Service() {
             when (msg.what) {
                 CMD_CRASH_PARENT_NATIVE -> {
                     val settings = GeckoSessionSettings()
                     val session = GeckoSession(settings)
                     session.open(runtime!!)
                     session.loadUri("about:crashparent")
                 }
                 CMD_CRASH_CONTENT_NATIVE -> {
-                    val settings = GeckoSessionSettings.Builder().useMultiprocess(true).build()
+                    val settings = GeckoSessionSettings.Builder()
+                            .useMultiprocess(true)
+                            .build()
                     val session = GeckoSession(settings)
                     session.open(runtime!!)
                     session.loadUri("about:crashcontent")
                 }
                 else -> {
                     throw RuntimeException("Unhandled command")
                 }
             }
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java
@@ -210,41 +210,52 @@ public class GeckoSessionTestRule implem
                 final ParameterizedType genericType = (ParameterizedType) field.getGenericType();
                 mType = (Class<?>) genericType.getActualTypeArguments()[0];
             }
 
             @SuppressWarnings("unchecked")
             public void set(final GeckoSessionSettings settings, final String value) {
                 try {
                     if (boolean.class.equals(mType) || Boolean.class.equals(mType)) {
-                            Method method = GeckoSessionSettings.class.getDeclaredMethod("setBoolean", GeckoSessionSettings.Key.class, boolean.class);
-                            method.setAccessible(true);
-                            method.invoke(settings, mKey, Boolean.valueOf(value));
+                        Method method = GeckoSessionSettings.class
+                                .getDeclaredMethod("setBoolean",
+                                        GeckoSessionSettings.Key.class,
+                                        boolean.class);
+                        method.setAccessible(true);
+                        method.invoke(settings, mKey, Boolean.valueOf(value));
                     } else if (int.class.equals(mType) || Integer.class.equals(mType)) {
-                        Method method = GeckoSessionSettings.class.getDeclaredMethod("setInt", GeckoSessionSettings.Key.class, int.class);
+                        Method method = GeckoSessionSettings.class
+                                .getDeclaredMethod("setInt",
+                                        GeckoSessionSettings.Key.class,
+                                        int.class);
                         method.setAccessible(true);
                         try {
                             method.invoke(settings, mKey,
                                     (Integer)GeckoSessionSettings.class.getField(value)
                                             .get(null));
                         }
                         catch (final NoSuchFieldException | IllegalAccessException |
                                 ClassCastException e) {
                             method.invoke(settings, mKey,
                                     Integer.valueOf(value));
                         }
                     } else if (String.class.equals(mType)) {
-                        Method method = GeckoSessionSettings.class.getDeclaredMethod("setString", GeckoSessionSettings.Key.class, String.class);
+                        Method method = GeckoSessionSettings.class
+                                .getDeclaredMethod("setString",
+                                        GeckoSessionSettings.Key.class,
+                                        String.class);
                         method.setAccessible(true);
                         method.invoke(settings, mKey, value);
                     } else {
                         throw new IllegalArgumentException("Unsupported type: " +
                                 mType.getSimpleName());
                     }
-                } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+                } catch (NoSuchMethodException
+                        | IllegalAccessException
+                        | InvocationTargetException e) {
                     throw new RuntimeException(e);
                 }
             }
         }
 
         @Target({ElementType.METHOD, ElementType.TYPE})
         @Retention(RetentionPolicy.RUNTIME)
         @interface List {
@@ -843,17 +854,19 @@ public class GeckoSessionTestRule implem
     protected boolean mClosedSession;
     protected boolean mWithDevTools;
     protected Map<GeckoSession, Tab> mRDPTabs;
     protected Tab mRDPChromeProcess;
     protected boolean mReuseSession;
     protected boolean mIgnoreCrash;
 
     public GeckoSessionTestRule() {
-        mDefaultSettings = new GeckoSessionSettings.Builder().useMultiprocess(env.isMultiprocess()).build();
+        mDefaultSettings = new GeckoSessionSettings.Builder()
+                .useMultiprocess(env.isMultiprocess())
+                .build();
     }
 
     /**
      * Set an ErrorCollector for assertion errors, or null to not use one.
      *
      * @param ec ErrorCollector or null.
      */
     public void setErrorCollector(final @Nullable ErrorCollector ec) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -1240,17 +1240,17 @@ public class GeckoSession implements Par
         ThreadUtils.assertOnUiThread();
 
         if (isOpen()) {
             // We will leak the existing Window if we open another one.
             throw new IllegalStateException("Session is open");
         }
 
         final String chromeUri = mSettings.getChromeUri();
-        final int screenId =mSettings.getScreenId();
+        final int screenId = mSettings.getScreenId();
         final boolean isPrivate = mSettings.getUsePrivateMode();
 
         mWindow = new Window(runtime, this, mNativeQueue);
 
         onWindowChanged(WINDOW_OPEN, /* inProgress */ true);
 
         if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
             Window.open(mWindow, mNativeQueue, mCompositor, mEventDispatcher,