Commit 77afd92b authored by MozLando's avatar MozLando
Browse files

Merge #4811

4811: Issue #4810: browser-state: Child tabs not added next to their parent r=pocmo a=csadilek

This is a follow-up to

Co-authored-by: default avatarChristian Sadilek <>
parents d6ea4775 1cec449a
......@@ -48,6 +48,34 @@ class SessionManagerMigrationTest {
fun `Add session with parent`() {
val store = BrowserStore()
val sessionManager = SessionManager(engine = mock(), store = store)
val parent = Session("")
assertEquals(1, sessionManager.sessions.size)
assertEquals(1, store.state.tabs.size)
// Make sure child tab was added next to parent
val child = Session("")
sessionManager.add(child, parent = parent)
assertEquals(3, sessionManager.sessions.size)
assertEquals(parent, sessionManager.all.toTypedArray()[0])
assertEquals(child, sessionManager.all.toTypedArray()[1])
assertEquals(3, store.state.tabs.size)
assertEquals("", store.state.tabs[0].content.url)
assertEquals("", store.state.tabs[1].content.url)
fun `Add custom tab session`() {
val store = BrowserStore()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment