| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @enum {string} | 8 * @enum {string} |
| 9 * @const | 9 * @const |
| 10 */ | 10 */ |
| (...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 appId, | 1846 appId, |
| 1847 ['#profile-badge[src]', null, true], | 1847 ['#profile-badge[src]', null, true], |
| 1848 this.next); | 1848 this.next); |
| 1849 }, | 1849 }, |
| 1850 // The image is gone. | 1850 // The image is gone. |
| 1851 function(result) { | 1851 function(result) { |
| 1852 checkIfNoErrorsOccured(this.next); | 1852 checkIfNoErrorsOccured(this.next); |
| 1853 } | 1853 } |
| 1854 ]); | 1854 ]); |
| 1855 }; | 1855 }; |
| 1856 |
| 1857 testcase.multiProfileVisitDesktopMenu = function() { |
| 1858 var appId; |
| 1859 StepsRunner.run([ |
| 1860 function() { |
| 1861 setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next); |
| 1862 }, |
| 1863 // Add all users. |
| 1864 function(inAppId) { |
| 1865 appId = inAppId; |
| 1866 chrome.test.sendMessage(JSON.stringify({name: 'addAllUsers'}), |
| 1867 this.next); |
| 1868 }, |
| 1869 // Wait for menu items. Profiles for non-current desktop should appear and |
| 1870 // the profile for the current desktop (alice) should be hidden. |
| 1871 function(json) { |
| 1872 chrome.test.assertTrue(JSON.parse(json)); |
| 1873 callRemoteTestUtil('waitForVisitDesktopMenu', |
| 1874 appId, |
| 1875 ['bob@invalid.domain', true], |
| 1876 this.next); |
| 1877 }, |
| 1878 function() { |
| 1879 callRemoteTestUtil('waitForVisitDesktopMenu', |
| 1880 appId, |
| 1881 ['charlie@invalid.domain', true], |
| 1882 this.next); |
| 1883 }, |
| 1884 function() { |
| 1885 callRemoteTestUtil('waitForVisitDesktopMenu', |
| 1886 appId, |
| 1887 ['alice@invalid.domain', false], |
| 1888 this.next); |
| 1889 }, |
| 1890 // Activate the visit desktop menu. |
| 1891 function() { |
| 1892 callRemoteTestUtil('runVisitDesktopMenu', |
| 1893 appId, |
| 1894 ['bob@invalid.domain'], |
| 1895 this.next); |
| 1896 }, |
| 1897 // Wait for the new menu state. Now 'alice' is shown and 'bob' is hidden. |
| 1898 function(result) { |
| 1899 chrome.test.assertTrue(result); |
| 1900 callRemoteTestUtil('waitForVisitDesktopMenu', |
| 1901 appId, |
| 1902 ['alice@invalid.domain', true], |
| 1903 this.next); |
| 1904 }, |
| 1905 function() { |
| 1906 callRemoteTestUtil('waitForVisitDesktopMenu', |
| 1907 appId, |
| 1908 ['charlie@invalid.domain', true], |
| 1909 this.next); |
| 1910 }, |
| 1911 function() { |
| 1912 callRemoteTestUtil('waitForVisitDesktopMenu', |
| 1913 appId, |
| 1914 ['bob@invalid.domain', false], |
| 1915 this.next); |
| 1916 }, |
| 1917 // Check that the window owner has indeed been changed. |
| 1918 function() { |
| 1919 chrome.test.sendMessage(JSON.stringify({name: 'getWindowOwnerId'}), |
| 1920 this.next); |
| 1921 }, |
| 1922 function(result) { |
| 1923 chrome.test.assertEq('bob@invalid.domain', result); |
| 1924 checkIfNoErrorsOccured(this.next); |
| 1925 } |
| 1926 ]); |
| 1927 }; |
| OLD | NEW |