@@ -168,5 +168,24 @@ Item {
168 tlwm.rootFocus = true;
168 tlwm.rootFocus = true;
169 compare(dialerApp.focused, true);
169 compare(dialerApp.focused, true);
173+ Ensure that the newly-opened window from an already-opened app will
174+ be focused in addition to being on top.
176+ function test_focusNewWindowFromOpenedApp()
178+ var firstWindowSurfaceId = tlwm.nextId;
179+ var webbrowserApp = ApplicationManager.startApplication("morph-browser");
180+ waitUntilAppSurfaceShowsUp(firstWindowSurfaceId);
182+ // Create the second window
183+ var secondWindowSurfaceId = tlwm.nextId;
184+ webbrowserApp.createSurface();
186+ var topWindow = tlwm.windowAt(0);
187+ compare(topWindow.id, secondWindowSurfaceId, "The top window is not the second window.");
188+ compare(topWindow.focused, true, "The second window isn't focused.");