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 1103589 - Support window.open calls from a private browser r=gduan
- Loading branch information
1 parent
058396f
commit acde76b
Showing
5 changed files
with
83 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
75 changes: 75 additions & 0 deletions
75
apps/system/test/marionette/browser_private_window_open_test.js
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,75 @@ | ||
'use strict'; | ||
|
||
var Home = require( | ||
'../../../../apps/verticalhome/test/marionette/lib/home2'); | ||
var Search = require( | ||
'../../../../apps/search/test/marionette/lib/search'); | ||
var Server = require('../../../../shared/test/integration/server'); | ||
var Rocketbar = require('./lib/rocketbar'); | ||
|
||
marionette('Private Browser - Window.open', function() { | ||
|
||
var client = marionette.client({ | ||
prefs: { | ||
'focusmanager.testmode': true, | ||
'dom.w3c_touch_events.enabled': 1 | ||
}, | ||
settings: { | ||
'ftu.manifestURL': null, | ||
'lockscreen.enabled': false | ||
} | ||
}); | ||
|
||
var home, rocketbar, search, server, system; | ||
|
||
suiteSetup(function(done) { | ||
Server.create(__dirname + '/fixtures/', function(err, _server) { | ||
server = _server; | ||
done(); | ||
}); | ||
}); | ||
|
||
suiteTeardown(function() { | ||
server.stop(); | ||
}); | ||
|
||
setup(function() { | ||
home = new Home(client); | ||
rocketbar = new Rocketbar(client); | ||
search = new Search(client); | ||
system = client.loader.getAppClass('system'); | ||
system.waitForStartup(); | ||
|
||
search.removeGeolocationPermission(); | ||
}); | ||
|
||
test('Open windows from private browsers are also private', function() { | ||
// Use the home-screen search box to open up the system browser | ||
var url = server.url('sample.html'); | ||
rocketbar.homescreenFocus(); | ||
search.triggerFirstRun(rocketbar); | ||
rocketbar.enterText(url + '\uE006'); | ||
system.gotoBrowser(url); | ||
|
||
client.switchToFrame(); | ||
system.appChromeContextLink.tap(); | ||
system.appChromeContextNewPrivate.tap(); | ||
system.gotoBrowser('app://system.gaiamobile.org/private_browser.html'); | ||
|
||
client.switchToFrame(); | ||
system.appUrlbar.tap(); | ||
|
||
var opener = server.url('windowopen.html'); | ||
rocketbar.enterText(opener + '\uE006'); | ||
system.gotoBrowser(opener); | ||
client.findElement('#trigger1').click(); | ||
client.switchToFrame(); | ||
|
||
var browsers; | ||
client.waitFor(function() { | ||
browsers = client.findElements( | ||
'.appWindow.private iframe[data-url*="http://localhost"]'); | ||
return browsers.length === 2; | ||
}); | ||
}); | ||
}); |
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