Bug 1918791 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I've started exploring this path by:
* Adjusting [BaseSessionTest](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/BaseSessionTest.kt#30) to take an optional of `geckoRuntimeSettings`
* Passing that to [GeckoSessionTestRule](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java#885,892) 
* Changing RuntimeCreator [getRuntime](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java#142-171) to move out the builder as a default and take specified settings.

Interestingly, this approach worked on the tests I wrote that used different runtime settings when ran indivdually, but did not when ran with other tests. I'll try to spend more time working on this approach, but documenting it here in case I find another way to test the patch in bug 1914655.
I've started exploring this path by:
* Adjusting [BaseSessionTest](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/BaseSessionTest.kt#30) to take an optional of `geckoRuntimeSettings`
* Passing that to [GeckoSessionTestRule](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java#885,892) 
* Changing RuntimeCreator [getRuntime](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java#142-171) to move out the builder as a default and take specified settings.

Interestingly, this approach worked on the tests I wrote that used different runtime settings when ran indivdually, but did not when ran with other tests. I'll try to spend more time working on this approach, but documenting it here in case I find another way to test the patch in bug 1914655.

Edit: With more investigation it is because the GeckoRuntime stays the same between tests. So, this idea will work individually, but not when ran as a part of a suite. Looking for an option to reset the runtime between tests.
I've started exploring this path by:
* Adjusting [BaseSessionTest](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/BaseSessionTest.kt#30) to take an optional of `geckoRuntimeSettings`
* Passing that to [GeckoSessionTestRule](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java#885,892) 
* Changing RuntimeCreator [getRuntime](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java#142-171) to move out the builder as a default and take specified settings.

Interestingly, this approach worked on the tests I wrote that used different runtime settings when ran indivdually, but did not when ran with other tests. I'll try to spend more time working on this approach, but documenting it here in case I find another way to test the patch in bug 1914655.

Edit: With more investigation it is because the GeckoRuntime stays the same between tests. So, this idea will work individually, but not when ran as a part of a suite. Looking for an option to reset the runtime between tests. 

Best lead I have right now is, this comment seems like I [might be able to bind it to the individual test](https://searchfox.org/mozilla-central/rev/a13db27562f9237db97e2ea5b01dc879d5b55b74/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java#560-561), so I can close it without closing the test.
I've started exploring this path by:
* Adjusting [BaseSessionTest](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/BaseSessionTest.kt#30) to take an optional of `geckoRuntimeSettings`
* Passing that to [GeckoSessionTestRule](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java#885,892) 
* Changing RuntimeCreator [getRuntime](https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/RuntimeCreator.java#142-171) to move out the builder as a default and take specified settings.

Interestingly, this approach worked on the tests I wrote that used different runtime settings when ran indivdually, but did not when ran with other tests. I'll try to spend more time working on this approach, but documenting it here in case I find another way to test the patch in bug 1914655.

Edit: With more investigation it is because the GeckoRuntime stays the same between tests. So, this idea will work individually, but not when ran as a part of a suite. Looking for an option to reset the runtime between tests. 

Best lead I have right now is, this comment seems like I [might be able to bind it to the individual test](https://searchfox.org/mozilla-central/rev/a13db27562f9237db97e2ea5b01dc879d5b55b74/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java#560-561), so I can close the runtime without closing the test.

Back to Bug 1918791 Comment 1