@@ -168,5 +168,24 @@ Item {
168168 tlwm.rootFocus = true;
169169 compare(dialerApp.focused, true);
170170 }
171+
172+ /*
173+ Ensure that the newly-opened window from an already-opened app will
174+ be focused in addition to being on top.
175+ */
176+ function test_focusNewWindowFromOpenedApp()
177+ {
178+ var firstWindowSurfaceId = tlwm.nextId;
179+ var webbrowserApp = ApplicationManager.startApplication("morph-browser");
180+ waitUntilAppSurfaceShowsUp(firstWindowSurfaceId);
181+
182+ // Create the second window
183+ var secondWindowSurfaceId = tlwm.nextId;
184+ webbrowserApp.createSurface();
185+
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.");
189+ }
171190 }
172191}