Home | History | Annotate | Download | only in wm

Lines Matching refs:token

51         final WindowTestUtils.TestWindowToken token =
54 assertEquals(0, token.getWindowsCount());
56 final WindowState window1 = createWindow(null, TYPE_APPLICATION, token, "window1");
57 final WindowState window11 = createWindow(window1, FIRST_SUB_WINDOW, token, "window11");
58 final WindowState window12 = createWindow(window1, FIRST_SUB_WINDOW, token, "window12");
59 final WindowState window2 = createWindow(null, TYPE_APPLICATION, token, "window2");
60 final WindowState window3 = createWindow(null, TYPE_APPLICATION, token, "window3");
62 token.addWindow(window1);
63 // NOTE: Child windows will not be added to the token as window containers can only
65 token.addWindow(window11);
66 token.addWindow(window12);
67 token.addWindow(window2);
68 token.addWindow(window3);
71 assertEquals(3, token.getWindowsCount());
72 assertTrue(token.hasWindow(window1));
73 assertFalse(token.hasWindow(window11));
74 assertFalse(token.hasWindow(window12));
75 assertTrue(token.hasWindow(window2));
76 assertTrue(token.hasWindow(window3));
82 final WindowTestUtils.TestWindowToken token = WindowTestUtils.createTestWindowToken(0, dc);
84 assertEquals(token, dc.getWindowToken(token.token));
86 final WindowState window1 = createWindow(null, TYPE_APPLICATION, token, "window1");
87 final WindowState window2 = createWindow(null, TYPE_APPLICATION, token, "window2");
90 // The token should still be mapped in the display content since it still has a child.
91 assertEquals(token, dc.getWindowToken(token.token));
94 // The token should have been removed from the display content since it no longer has a
96 assertEquals(null, dc.getWindowToken(token.token));
100 * Test that a window token isn't orphaned by the system when it is requested to be removed.
105 final WindowTestUtils.TestWindowToken token = WindowTestUtils.createTestWindowToken(
108 // Verify that the token is on the display
109 assertNotNull(mDisplayContent.getWindowToken(token.token));
111 final WindowState window1 = createWindow(null, TYPE_TOAST, token, "window1");
112 final WindowState window2 = createWindow(null, TYPE_TOAST, token, "window2");
114 mDisplayContent.removeWindowToken(token.token);
115 // Verify that the token is no longer mapped on the display
116 assertNull(mDisplayContent.getWindowToken(token.token));
117 // Verify that the token is still attached to its parent
118 assertNotNull(token.getParent());
119 // Verify that the token windows are still around.
120 assertEquals(2, token.getWindowsCount());
123 // Verify that the token is still attached to its parent
124 assertNotNull(token.getParent());
125 // Verify that the other token window is still around.
126 assertEquals(1, token.getWindowsCount());
129 // Verify that the token is no-longer attached to its parent
130 assertNull(token.getParent());
131 // Verify that the token windows are no longer attached to it.
132 assertEquals(0, token.getWindowsCount());