Skip to content

Commit

Permalink
Bug 1735786 - Fix GeckoView tests for https-first. r=calu
Browse files Browse the repository at this point in the history
  • Loading branch information
agi committed Nov 15, 2021
1 parent c7e05a7 commit 6c63bd2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
browser.notifications.create("cake-notification", {
type: "basic",
title: "Time for cake!",
iconUrl: "http://example.com/img.svg",
iconUrl: "https://example.com/img.svg",
message: "Something something cake",
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ open class BaseSessionTest(noErrorCollector: Boolean = false) {
const val VIDEO_MP4_PATH = "/assets/www/mp4.html"
const val VIDEO_WEBM_PATH = "/assets/www/webm.html"
const val VIDEO_BAD_PATH = "/assets/www/badVideoPath.html"
const val UNKNOWN_HOST_URI = "http://www.test.invalid/"
const val UNKNOWN_HOST_URI = "https://www.test.invalid/"
const val UNKNOWN_PROTOCOL_URI = "htt://invalid"
const val FULLSCREEN_PATH = "/assets/www/fullscreen.html"
const val VIEWPORT_PATH = "/assets/www/viewport.html"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,14 @@ class NavigationDelegateTest : BaseSessionTest() {
assumeThat(sessionRule.env.isIsolatedProcess, equalTo(false))

val redirectUri = if (sessionRule.env.isAutomation) {
"http://example.org/tests/junit/hello.html"
"https://example.org/tests/junit/hello.html"
} else {
"http://jigsaw.w3.org/HTTP/300/Overview.html"
"https://jigsaw.w3.org/HTTP/300/Overview.html"
}
val uri = if (sessionRule.env.isAutomation) {
"http://example.org/tests/junit/simple_redirect.sjs?$redirectUri"
"https://example.org/tests/junit/simple_redirect.sjs?$redirectUri"
} else {
"http://jigsaw.w3.org/HTTP/300/301.html"
"https://jigsaw.w3.org/HTTP/300/301.html"
}

sessionRule.session.loadUri(uri)
Expand Down Expand Up @@ -791,14 +791,14 @@ class NavigationDelegateTest : BaseSessionTest() {
assumeThat(sessionRule.env.isIsolatedProcess, equalTo(false))

val redirectUri = if (sessionRule.env.isAutomation) {
"http://example.org/tests/junit/hello.html"
"https://example.org/tests/junit/hello.html"
} else {
"http://jigsaw.w3.org/HTTP/300/Overview.html"
"https://jigsaw.w3.org/HTTP/300/Overview.html"
}
val uri = if (sessionRule.env.isAutomation) {
"http://example.org/tests/junit/simple_redirect.sjs?$redirectUri"
"https://example.org/tests/junit/simple_redirect.sjs?$redirectUri"
} else {
"http://jigsaw.w3.org/HTTP/300/301.html"
"https://jigsaw.w3.org/HTTP/300/301.html"
}

sessionRule.delegateDuringNextWait(
Expand Down Expand Up @@ -846,7 +846,7 @@ class NavigationDelegateTest : BaseSessionTest() {
assumeThat(sessionRule.env.isIsolatedProcess, equalTo(false))

val redirectUri = "intent://test"
val uri = "http://example.org/tests/junit/simple_redirect.sjs?$redirectUri"
val uri = "https://example.org/tests/junit/simple_redirect.sjs?$redirectUri"

sessionRule.session.loadUri(uri)
sessionRule.waitForPageStop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun installBuiltIn() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -173,7 +173,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun enableDisable() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

sessionRule.delegateDuringNextWait(object : WebExtensionController.PromptDelegate {
Expand Down Expand Up @@ -219,7 +219,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun installWebExtension() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -275,7 +275,7 @@ class WebExtensionTest : BaseSessionTest() {
@Test
@Setting.List(Setting(key = Setting.Key.USE_PRIVATE_MODE, value = "true"))
fun runInPrivateBrowsing() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// Make sure border is empty before running the extension
Expand Down Expand Up @@ -477,7 +477,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun installDeny() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// Ensure border is empty to start.
Expand Down Expand Up @@ -523,7 +523,7 @@ class WebExtensionTest : BaseSessionTest() {
override fun onShowNotification(notification: WebNotification) {
assertEquals(notification.title, "Time for cake!")
assertEquals(notification.text, "Something something cake")
assertEquals(notification.imageUrl, "http://example.com/img.svg")
assertEquals(notification.imageUrl, "https://example.com/img.svg")
// This should be filled out, Bug 1589693
assertEquals(notification.source, null)
}
Expand Down Expand Up @@ -1255,7 +1255,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun contentMessaging() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()
testOnMessage(false)
}
Expand Down Expand Up @@ -1324,7 +1324,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun contentPortMessaging() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()
testPortMessage(false)
}
Expand Down Expand Up @@ -1402,7 +1402,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun contentPortDisconnect() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()
testPortDisconnect(background=false, refresh=false)
}
Expand All @@ -1414,7 +1414,7 @@ class WebExtensionTest : BaseSessionTest() {

@Test
fun contentPortDisconnectAfterRefresh() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()
testPortDisconnect(background=false, refresh=true)
}
Expand All @@ -1433,7 +1433,7 @@ class WebExtensionTest : BaseSessionTest() {
assertEquals("Called from background script, expecting only content scripts",
sender.environmentType, WebExtension.MessageSender.ENV_TYPE_CONTENT_SCRIPT)
assertTrue("Expecting only top level senders.", sender.isTopLevel)
assertEquals("Unexpected sender url", sender.url, "http://example.com/")
assertEquals("Unexpected sender url", sender.url, "https://example.com/")
}
}

Expand Down Expand Up @@ -1480,7 +1480,7 @@ class WebExtensionTest : BaseSessionTest() {
@Test
fun contentPortDisconnectFromApp() {
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()
testPortDisconnectFromApp(false)
}
Expand Down Expand Up @@ -1622,13 +1622,13 @@ class WebExtensionTest : BaseSessionTest() {
}
})

mainSession.loadUri("http://example.com")
mainSession.loadUri("https://example.com")

mainSession.waitUntilCalled(object : NavigationDelegate, ProgressDelegate {
@GeckoSessionTestRule.AssertCalled(count = 1)
override fun onLocationChange(session: GeckoSession, url: String?) {
assertThat("Url should load example.com first",
url, equalTo("http://example.com/"))
url, equalTo("https://example.com/"))
}

@GeckoSessionTestRule.AssertCalled(count = 1)
Expand Down Expand Up @@ -1748,7 +1748,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.install.requireBuiltInCerts" to false,
"extensions.update.requireBuiltInCerts" to false
))
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -1800,7 +1800,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.install.requireBuiltInCerts" to false,
"extensions.update.requireBuiltInCerts" to false
))
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -1866,7 +1866,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.install.requireBuiltInCerts" to false,
"extensions.update.requireBuiltInCerts" to false
))
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -1912,7 +1912,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.install.requireBuiltInCerts" to false,
"extensions.update.requireBuiltInCerts" to false
))
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -2010,7 +2010,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.update.requireBuiltInCerts" to false,
"extensions.webextensions.warnings-as-errors" to false
))
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

// First let's check that the color of the border is empty before loading
Expand Down Expand Up @@ -2063,7 +2063,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.install.requireBuiltInCerts" to false,
"extensions.update.requireBuiltInCerts" to false
))
mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

sessionRule.delegateDuringNextWait(object : WebExtensionController.PromptDelegate {
Expand Down Expand Up @@ -2175,7 +2175,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.update.requireBuiltInCerts" to false
))

mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

sessionRule.delegateDuringNextWait(object : WebExtensionController.PromptDelegate {
Expand Down Expand Up @@ -2244,7 +2244,7 @@ class WebExtensionTest : BaseSessionTest() {
"extensions.update.requireBuiltInCerts" to false
))

mainSession.loadUri("example.com")
mainSession.loadUri("https://example.com")
sessionRule.waitForPageStop()

sessionRule.delegateDuringNextWait(object : WebExtensionController.PromptDelegate {
Expand Down

0 comments on commit 6c63bd2

Please sign in to comment.