| Index: chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
|
| diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
|
| index a8f1054cab55581ef804c8abb383445378de2b1c..5084042fceb7c081a933462912d64ac22fc50777 100644
|
| --- a/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
|
| +++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
|
| @@ -1853,3 +1853,75 @@ testcase.multiProfileBadge = function() {
|
| }
|
| ]);
|
| };
|
| +
|
| +testcase.multiProfileVisitDesktopMenu = function() {
|
| + var appId;
|
| + StepsRunner.run([
|
| + function() {
|
| + setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
|
| + },
|
| + // Add all users.
|
| + function(inAppId) {
|
| + appId = inAppId;
|
| + chrome.test.sendMessage(JSON.stringify({name: 'addAllUsers'}),
|
| + this.next);
|
| + },
|
| + // Wait for menu items. Profiles for non-current desktop should appear and
|
| + // the profile for the current desktop (alice) should be hidden.
|
| + function(json) {
|
| + chrome.test.assertTrue(JSON.parse(json));
|
| + callRemoteTestUtil('waitForVisitDesktopMenu',
|
| + appId,
|
| + ['bob@invalid.domain', true],
|
| + this.next);
|
| + },
|
| + function() {
|
| + callRemoteTestUtil('waitForVisitDesktopMenu',
|
| + appId,
|
| + ['charlie@invalid.domain', true],
|
| + this.next);
|
| + },
|
| + function() {
|
| + callRemoteTestUtil('waitForVisitDesktopMenu',
|
| + appId,
|
| + ['alice@invalid.domain', false],
|
| + this.next);
|
| + },
|
| + // Activate the visit desktop menu.
|
| + function() {
|
| + callRemoteTestUtil('runVisitDesktopMenu',
|
| + appId,
|
| + ['bob@invalid.domain'],
|
| + this.next);
|
| + },
|
| + // Wait for the new menu state. Now 'alice' is shown and 'bob' is hidden.
|
| + function(result) {
|
| + chrome.test.assertTrue(result);
|
| + callRemoteTestUtil('waitForVisitDesktopMenu',
|
| + appId,
|
| + ['alice@invalid.domain', true],
|
| + this.next);
|
| + },
|
| + function() {
|
| + callRemoteTestUtil('waitForVisitDesktopMenu',
|
| + appId,
|
| + ['charlie@invalid.domain', true],
|
| + this.next);
|
| + },
|
| + function() {
|
| + callRemoteTestUtil('waitForVisitDesktopMenu',
|
| + appId,
|
| + ['bob@invalid.domain', false],
|
| + this.next);
|
| + },
|
| + // Check that the window owner has indeed been changed.
|
| + function() {
|
| + chrome.test.sendMessage(JSON.stringify({name: 'getWindowOwnerId'}),
|
| + this.next);
|
| + },
|
| + function(result) {
|
| + chrome.test.assertEq('bob@invalid.domain', result);
|
| + checkIfNoErrorsOccured(this.next);
|
| + }
|
| + ]);
|
| +};
|
|
|