Backed out 2 changesets (bug 1638724, bug 1640418) for build bustages on WebExtensionTest.kt. CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Tue, 07 Jul 2020 21:47:40 +0300
changeset 539184 078f263b3757d9075ab7aa0edaee65009da7ae4b
parent 539183 570ccdfb855db8e2a3d23487a42afa5593fb71c0
child 539185 333d035afe9299dee842ad1e6aab558d8fd13845
push id120986
push usernbeleuzu@mozilla.com
push dateTue, 07 Jul 2020 18:48:23 +0000
treeherderautoland@078f263b3757 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1638724, 1640418
milestone80.0a1
backs outca9ad40caa79625a5fca604e3af6488497115a6d
8824d1cadb7ae779956c87bd5d00f6f8a4c5113c
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
Backed out 2 changesets (bug 1638724, bug 1640418) for build bustages on WebExtensionTest.kt. CLOSED TREE Backed out changeset ca9ad40caa79 (bug 1638724) Backed out changeset 8824d1cadb7a (bug 1640418)
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PromptDelegateTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExtensionTest.kt
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PromptDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PromptDelegateTest.kt
@@ -11,16 +11,17 @@ import org.mozilla.geckoview.test.util.C
 
 import androidx.test.filters.MediumTest
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import org.hamcrest.Matchers.*
 import org.junit.Assert
 import org.junit.Ignore
 import org.junit.Test
 import org.junit.runner.RunWith
+import org.junit.Assume.assumeThat
 
 @RunWith(AndroidJUnit4::class)
 @MediumTest
 class PromptDelegateTest : BaseSessionTest() {
     @Test fun popupTestAllow() {
         // Ensure popup blocking is enabled for this test.
         sessionRule.setPrefsUntilTestEnd(mapOf("dom.disable_open_during_load" to true))
 
@@ -142,69 +143,66 @@ class PromptDelegateTest : BaseSessionTe
             }
         })
 
         assertThat("Result should match",
                 sessionRule.session.waitForJS("confirm('Confirm?')") as Boolean,
                 equalTo(false))
     }
 
+    // disable test on opt for frequently failing Bug 1640418
     @Test
     fun onBeforeUnloadTest() {
+        assumeThat(sessionRule.env.isDebugBuild, equalTo(true))
         sessionRule.setPrefsUntilTestEnd(mapOf(
                 "dom.require_user_interaction_for_beforeunload" to false
         ))
         sessionRule.session.loadTestPath(BEFORE_UNLOAD)
         sessionRule.waitForPageStop()
 
         val result = GeckoResult<Void>()
         sessionRule.delegateUntilTestEnd(object: Callbacks.ProgressDelegate {
             override fun onPageStart(session: GeckoSession, url: String) {
                 assertThat("Only HELLO2_HTML_PATH should load", url, endsWith(HELLO2_HTML_PATH))
                 result.complete(null)
             }
         })
 
-        val promptResult = GeckoResult<PromptDelegate.PromptResponse>()
-        val promptResult2 = GeckoResult<PromptDelegate.PromptResponse>()
-
+        var promptResult = GeckoResult<PromptDelegate.PromptResponse>()
         sessionRule.delegateUntilTestEnd(object : Callbacks.PromptDelegate {
-            @AssertCalled(count = 2)
             override fun onBeforeUnloadPrompt(session: GeckoSession, prompt: PromptDelegate.BeforeUnloadPrompt): GeckoResult<PromptDelegate.PromptResponse>? {
                 // We have to return something here because otherwise the delegate will be invoked
                 // before we have a chance to override it in the waitUntilCalled call below
-                return forEachCall(promptResult, promptResult2)
+                return promptResult
             }
         })
 
         // This will try to load "hello.html" but will be denied, if the request
         // goes through anyway the onLoadRequest delegate above will throw an exception
         sessionRule.session.evaluateJS("document.querySelector('#navigateAway').click()")
         sessionRule.waitUntilCalled(object : Callbacks.PromptDelegate {
             @AssertCalled(count = 1)
             override fun onBeforeUnloadPrompt(session: GeckoSession, prompt: PromptDelegate.BeforeUnloadPrompt): GeckoResult<PromptDelegate.PromptResponse>? {
                 promptResult.complete(prompt.confirm(AllowOrDeny.DENY))
                 return promptResult
             }
         })
 
-        sessionRule.waitForResult(promptResult)
-
         // This request will go through and end the test. Doing the negative case first will
         // ensure that if either of this tests fail the test will fail.
+        promptResult = GeckoResult()
         sessionRule.session.evaluateJS("document.querySelector('#navigateAway2').click()")
         sessionRule.waitUntilCalled(object : Callbacks.PromptDelegate {
             @AssertCalled(count = 1)
             override fun onBeforeUnloadPrompt(session: GeckoSession, prompt: PromptDelegate.BeforeUnloadPrompt): GeckoResult<PromptDelegate.PromptResponse>? {
-                promptResult2.complete(prompt.confirm(AllowOrDeny.ALLOW))
-                return promptResult2
+                promptResult.complete(prompt.confirm(AllowOrDeny.ALLOW))
+                return promptResult
             }
         })
 
-        sessionRule.waitForResult(promptResult2)
         sessionRule.waitForResult(result)
     }
 
     @Test fun textTest() {
         sessionRule.session.loadTestPath(HELLO_HTML_PATH)
         sessionRule.session.waitForPageStop()
 
         sessionRule.delegateUntilTestEnd(object : Callbacks.PromptDelegate {
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExtensionTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExtensionTest.kt
@@ -550,17 +550,17 @@ class WebExtensionTest : BaseSessionTest
     fun testBrowserTabsCreateWithCookieStoreId() {
         val tabsCreateResult = GeckoResult<Void>()
         var tabsExtension: WebExtension? = null
         val tabDelegate = object : WebExtension.TabDelegate {
             override fun onNewTab(source: WebExtension, details: WebExtension.CreateTabDetails): GeckoResult<GeckoSession> {
                 assertEquals(details.url, "https://www.mozilla.org/en-US/")
                 assertEquals(details.active, true)
                 assertEquals(details.cookieStoreId, "1")
-                assertEquals(tabsExtension!!.id!!, source.id)
+                assertEquals(tabsExtension!!, source)
                 tabsCreateResult.complete(null)
                 return GeckoResult.fromValue(null)
             }
         }
 
         tabsExtension = sessionRule.waitForResult(controller.installBuiltIn(TABS_CREATE_2_BACKGROUND))
         tabsExtension.setTabDelegate(tabDelegate)
         sessionRule.waitForResult(tabsCreateResult)