Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20504 from jimporter/ringtones-hide-share-from-self
Browse files Browse the repository at this point in the history
Bug 1015513 - [ringtones] An app shouldn't be able to pick itself when l...
  • Loading branch information
Jim Porter authored and rvandermeulen committed Jun 24, 2014
1 parent 7476c5b commit 7260d58
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/ringtones/js/actions_menu.js
Expand Up @@ -80,6 +80,8 @@ ActionsMenu.prototype = {
name: 'share',
data: {
type: 'audio/*',
// Make sure we can't share with ourselves!
__bug1015513_hide_from_self__: true,
number: 1,
blobs: [blob],
filenames: [self._tone.name],
Expand Down
1 change: 1 addition & 0 deletions apps/ringtones/manifest.webapp
Expand Up @@ -31,6 +31,7 @@
"required": true,
"pattern": "^audio/.*$"
},
"__bug1015513_hide_from_self__": false,
"number": 1
},
"disposition": "inline",
Expand Down
1 change: 1 addition & 0 deletions apps/ringtones/test/marionette/lib/ringtones.js
Expand Up @@ -76,6 +76,7 @@ ActionsMenu.prototype = {
return list[i];
}
}
return null;
}
};
createElementGetters(
Expand Down
6 changes: 6 additions & 0 deletions apps/ringtones/test/marionette/manage_test.js
Expand Up @@ -140,6 +140,12 @@ marionette('Ringtone management', function() {
// the right data was sent...
var actionsMenu = container.soundLists[0].sounds[0].openActions();
actionsMenu.shareButton.tap();

// Make sure we can't share with ourselves, since that's weird.
assert.equal(actionsMenu.shareWith('Ringtones'), null,
'Ringtones app shouldn\'t be in Share menu');

// Share with the messages app.
actionsMenu.shareWith('Messages').tap();
});
});
Expand Down

0 comments on commit 7260d58

Please sign in to comment.