This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1029336 - Only disable contextmenu for certified apps. r=alive
- Loading branch information
1 parent
e298a65
commit d377fc6
Showing
8 changed files
with
103 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* global __dirname */ | ||
|
||
'use strict'; | ||
|
||
var Actions = require('marionette-client').Actions; | ||
|
||
var APP_NAME = 'contextmenuapp'; | ||
var APP_HOST = APP_NAME + '.gaiamobile.org'; | ||
var APP_URL = 'app://' + APP_HOST; | ||
|
||
marionette('Test Context Menu Events', function() { | ||
|
||
var opts = { | ||
settings: { | ||
'ftu.manifestURL': null, | ||
'lockscreen.enabled': false | ||
}, | ||
apps: {} | ||
}; | ||
|
||
opts.apps[APP_HOST] = __dirname + '/' + APP_NAME; | ||
|
||
var client = marionette.client(opts); | ||
var actions = new Actions(client); | ||
|
||
test('Test basic context menu functionality', function() { | ||
|
||
// Launch test app | ||
client.apps.launch(APP_URL); | ||
client.apps.switchToApp(APP_URL); | ||
|
||
// Long press on a link | ||
var link = client.helper.waitForElement('#link'); | ||
actions.longPress(link, 1.5).perform(); | ||
|
||
// Ensure the share and open tab menu items are present | ||
client.switchToFrame(); | ||
client.helper.waitForElement('[data-id=open-in-new-tab]'); | ||
client.helper.waitForElement('[data-id=share-link]'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Fake Activity Caller</title> | ||
</head> | ||
|
||
<body> | ||
<a href="http://example.com" id="link">A Link!</a> | ||
</body> | ||
|
||
</html> |
11 changes: 11 additions & 0 deletions
11
apps/system/test/marionette/contextmenuapp/manifest.webapp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "Context Menu App", | ||
"description": "App used to test context menus", | ||
"type": "privileged", | ||
"launch_path": "/index.html", | ||
"fullscreen": true, | ||
"developer": { | ||
"name": "The Gaia Team", | ||
"url": "https://github.com/mozilla-b2g/gaia" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters