mirror of
https://github.com/Feodor2/Mypal68.git
synced 2025-06-18 23:05:40 -04:00
68.14.8 - testing
This commit is contained in:
parent
047e832886
commit
68568abe3a
@ -47,7 +47,6 @@ class TestBrowserWindowShortcuts(PuppeteerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
# TODO: Check that the right input box is focused
|
# TODO: Check that the right input box is focused
|
||||||
# Located below searchbar as class="textbox-input"
|
# Located below searchbar as class="textbox-input"
|
||||||
# Anon locator has not been released yet (bug 1080764)
|
|
||||||
def has_input_selected(mn):
|
def has_input_selected(mn):
|
||||||
selection_name = mn.execute_script("""
|
selection_name = mn.execute_script("""
|
||||||
return window.document.activeElement.localName;
|
return window.document.activeElement.localName;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
[include:keyboard_shortcuts/manifest.ini]
|
[include:keyboard_shortcuts/manifest.ini]
|
||||||
[include:private_browsing/manifest.ini]
|
|
||||||
[include:safebrowsing/manifest.ini]
|
[include:safebrowsing/manifest.ini]
|
||||||
[include:security/manifest.ini]
|
[include:security/manifest.ini]
|
||||||
[include:sessionstore/manifest.ini]
|
[include:sessionstore/manifest.ini]
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
[DEFAULT]
|
|
||||||
tags = local
|
|
||||||
|
|
||||||
[test_about_private_browsing.py]
|
|
@ -1,73 +0,0 @@
|
|||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from firefox_puppeteer import PuppeteerMixin
|
|
||||||
from firefox_puppeteer.ui.browser.window import BrowserWindow
|
|
||||||
from marionette_driver import By, Wait
|
|
||||||
from marionette_harness import MarionetteTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestAboutPrivateBrowsingWithSearch(PuppeteerMixin, MarionetteTestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(TestAboutPrivateBrowsingWithSearch, self).setUp()
|
|
||||||
|
|
||||||
# Use a fake local support URL
|
|
||||||
support_url = 'about:blank?'
|
|
||||||
self.marionette.set_pref('app.support.baseURL', support_url)
|
|
||||||
self.pb_url = support_url + 'private-browsing-myths'
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
try:
|
|
||||||
self.puppeteer.windows.close_all([self.browser])
|
|
||||||
self.browser.switch_to()
|
|
||||||
|
|
||||||
self.marionette.clear_pref('app.support.baseURL')
|
|
||||||
finally:
|
|
||||||
super(TestAboutPrivateBrowsingWithSearch, self).tearDown()
|
|
||||||
|
|
||||||
def testCheckAboutPrivateBrowsingWithSearch(self):
|
|
||||||
self.assertFalse(self.browser.is_private)
|
|
||||||
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
self.marionette.navigate('about:privatebrowsing')
|
|
||||||
|
|
||||||
# Disabled awaiting support for Fluent strings in firefox-ui tests (bug 1534310)
|
|
||||||
# status_node = self.marionette.find_element(By.CSS_SELECTOR, 'p.showNormal')
|
|
||||||
# self.assertEqual(status_node.text,
|
|
||||||
# self.browser.localize_entity('aboutPrivateBrowsing.notPrivate'),
|
|
||||||
# 'Status text indicates we are not in private browsing mode')
|
|
||||||
|
|
||||||
def window_opener(win):
|
|
||||||
with win.marionette.using_context('content'):
|
|
||||||
button = self.marionette.find_element(By.ID, 'startPrivateBrowsing')
|
|
||||||
button.click()
|
|
||||||
|
|
||||||
pb_window = self.browser.open_window(callback=window_opener,
|
|
||||||
expected_window_class=BrowserWindow)
|
|
||||||
|
|
||||||
try:
|
|
||||||
self.assertTrue(pb_window.is_private)
|
|
||||||
|
|
||||||
# Test the search hand-off
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
search = self.marionette.find_element(By.ID, 'search-handoff-button')
|
|
||||||
search.click()
|
|
||||||
|
|
||||||
self.assertTrue(pb_window.navbar.locationbar.focused, 'url bar is focused')
|
|
||||||
|
|
||||||
pb_window.navbar.locationbar.urlbar.send_keys('foo')
|
|
||||||
self.assertEqual(pb_window.navbar.locationbar.value, '@google foo',
|
|
||||||
'url bar prepends the @search shortcut')
|
|
||||||
|
|
||||||
# Test the private browsing myths link
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
link = self.marionette.find_element(By.ID, 'private-browsing-myths')
|
|
||||||
link.click()
|
|
||||||
Wait(self.marionette, timeout=self.marionette.timeout.page_load).until(
|
|
||||||
lambda _: self.marionette.get_url() == self.pb_url)
|
|
||||||
|
|
||||||
finally:
|
|
||||||
pb_window.close()
|
|
@ -85,27 +85,13 @@ class TestLocationBar(PuppeteerMixin, MarionetteTestCase):
|
|||||||
self.locationbar = self.browser.navbar.locationbar
|
self.locationbar = self.browser.navbar.locationbar
|
||||||
|
|
||||||
def test_elements(self):
|
def test_elements(self):
|
||||||
self.assertEqual(self.locationbar.urlbar.get_property('localName'), 'textbox')
|
self.assertEqual(self.locationbar.urlbar_input.get_property('id'), 'urlbar-input')
|
||||||
self.assertIn('urlbar-input', self.locationbar.urlbar_input.get_property('className'))
|
|
||||||
|
|
||||||
self.assertEqual(self.locationbar.connection_icon.get_property('localName'), 'image')
|
|
||||||
self.assertEqual(self.locationbar.identity_box.get_property('localName'), 'box')
|
|
||||||
self.assertEqual(self.locationbar.identity_country_label.get_property('localName'),
|
|
||||||
'label')
|
|
||||||
self.assertEqual(self.locationbar.identity_organization_label.get_property('localName'),
|
|
||||||
'label')
|
|
||||||
self.assertEqual(self.locationbar.identity_icon.get_property('localName'), 'image')
|
|
||||||
self.assertEqual(self.locationbar.history_drop_marker.get_property('localName'),
|
|
||||||
'dropmarker')
|
|
||||||
self.assertEqual(self.locationbar.reload_button.get_property('localName'),
|
self.assertEqual(self.locationbar.reload_button.get_property('localName'),
|
||||||
'toolbarbutton')
|
'toolbarbutton')
|
||||||
self.assertEqual(self.locationbar.stop_button.get_property('localName'),
|
self.assertEqual(self.locationbar.stop_button.get_property('localName'),
|
||||||
'toolbarbutton')
|
'toolbarbutton')
|
||||||
|
|
||||||
self.assertEqual(self.locationbar.contextmenu.get_property('localName'), 'menupopup')
|
|
||||||
self.assertEqual(self.locationbar.get_contextmenu_entry('paste').get_attribute('cmd'),
|
|
||||||
'cmd_paste')
|
|
||||||
|
|
||||||
def test_reload(self):
|
def test_reload(self):
|
||||||
event_types = ["shortcut", "shortcut2", "button"]
|
event_types = ["shortcut", "shortcut2", "button"]
|
||||||
for event in event_types:
|
for event in event_types:
|
||||||
@ -131,83 +117,3 @@ class TestLocationBar(PuppeteerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
with self.marionette.using_context('content'):
|
with self.marionette.using_context('content'):
|
||||||
Wait(self.marionette).until(lambda mn: mn.get_url() == data_uri)
|
Wait(self.marionette).until(lambda mn: mn.get_url() == data_uri)
|
||||||
|
|
||||||
|
|
||||||
class TestIdentityPopup(PuppeteerMixin, MarionetteTestCase):
|
|
||||||
def setUp(self):
|
|
||||||
super(TestIdentityPopup, self).setUp()
|
|
||||||
|
|
||||||
self.locationbar = self.browser.navbar.locationbar
|
|
||||||
self.identity_popup = self.locationbar.identity_popup
|
|
||||||
|
|
||||||
self.url = 'https://extended-validation.badssl.com'
|
|
||||||
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
self.marionette.navigate(self.url)
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
try:
|
|
||||||
self.identity_popup.close(force=True)
|
|
||||||
finally:
|
|
||||||
super(TestIdentityPopup, self).tearDown()
|
|
||||||
|
|
||||||
def test_elements(self):
|
|
||||||
self.locationbar.open_identity_popup()
|
|
||||||
|
|
||||||
# Test main view elements
|
|
||||||
main = self.identity_popup.view.main
|
|
||||||
self.assertEqual(main.element.get_property('localName'), 'panelview')
|
|
||||||
|
|
||||||
self.assertEqual(main.expander.get_property('localName'), 'button')
|
|
||||||
self.assertEqual(main.host.get_property('localName'), 'label')
|
|
||||||
self.assertEqual(main.insecure_connection_label.get_property('localName'),
|
|
||||||
'description')
|
|
||||||
self.assertEqual(main.internal_connection_label.get_property('localName'),
|
|
||||||
'description')
|
|
||||||
self.assertEqual(main.secure_connection_label.get_property('localName'),
|
|
||||||
'description')
|
|
||||||
|
|
||||||
self.assertEqual(main.permissions.get_property('localName'), 'vbox')
|
|
||||||
|
|
||||||
# Test security view elements
|
|
||||||
security = self.identity_popup.view.security
|
|
||||||
self.assertEqual(security.element.get_property('localName'), 'panelview')
|
|
||||||
|
|
||||||
self.assertEqual(security.host.get_property('localName'), 'label')
|
|
||||||
self.assertEqual(security.insecure_connection_label.get_property('localName'),
|
|
||||||
'description')
|
|
||||||
self.assertEqual(security.secure_connection_label.get_property('localName'),
|
|
||||||
'description')
|
|
||||||
|
|
||||||
self.assertEqual(security.owner.get_property('localName'), 'description')
|
|
||||||
self.assertEqual(security.owner_location.get_property('localName'), 'description')
|
|
||||||
self.assertEqual(security.verifier.get_property('localName'), 'description')
|
|
||||||
|
|
||||||
self.assertEqual(security.disable_mixed_content_blocking_button.get_property('localName'),
|
|
||||||
'button')
|
|
||||||
self.assertEqual(security.enable_mixed_content_blocking_button.get_property('localName'),
|
|
||||||
'button')
|
|
||||||
|
|
||||||
self.assertEqual(security.more_info_button.get_property('localName'), 'button')
|
|
||||||
|
|
||||||
def test_open_close(self):
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
self.marionette.navigate(self.url)
|
|
||||||
|
|
||||||
self.assertFalse(self.identity_popup.is_open)
|
|
||||||
|
|
||||||
self.locationbar.open_identity_popup()
|
|
||||||
|
|
||||||
self.identity_popup.close()
|
|
||||||
self.assertFalse(self.identity_popup.is_open)
|
|
||||||
|
|
||||||
def test_force_close(self):
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
self.marionette.navigate(self.url)
|
|
||||||
|
|
||||||
self.assertFalse(self.identity_popup.is_open)
|
|
||||||
|
|
||||||
self.locationbar.open_identity_popup()
|
|
||||||
|
|
||||||
self.identity_popup.close(force=True)
|
|
||||||
self.assertFalse(self.identity_popup.is_open)
|
|
||||||
|
@ -68,7 +68,7 @@ class TestWindows(PuppeteerMixin, MarionetteTestCase):
|
|||||||
def open_by_js(_):
|
def open_by_js(_):
|
||||||
with self.marionette.using_context('chrome'):
|
with self.marionette.using_context('chrome'):
|
||||||
self.marionette.execute_script("""
|
self.marionette.execute_script("""
|
||||||
window.open('chrome://browser/content/safeMode.xul', '_blank',
|
window.open('chrome://browser/content/safeMode.xhtml', '_blank',
|
||||||
'chrome,centerscreen,resizable=no');
|
'chrome,centerscreen,resizable=no');
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
@ -41,20 +41,15 @@ capture.Format = {
|
|||||||
*
|
*
|
||||||
* @param {Node} node
|
* @param {Node} node
|
||||||
* The node to take a screenshot of.
|
* The node to take a screenshot of.
|
||||||
* @param {Array.<Node>=} highlights
|
|
||||||
* Optional array of nodes, around which a border will be marked to
|
|
||||||
* highlight them in the screenshot.
|
|
||||||
*
|
*
|
||||||
* @return {HTMLCanvasElement}
|
* @return {HTMLCanvasElement}
|
||||||
* The canvas element where the element has been painted on.
|
* The canvas element where the element has been painted on.
|
||||||
*/
|
*/
|
||||||
capture.element = function(node, highlights = []) {
|
capture.element = function(node) {
|
||||||
let win = node.ownerGlobal;
|
let win = node.ownerGlobal;
|
||||||
let rect = node.getBoundingClientRect();
|
let rect = node.getBoundingClientRect();
|
||||||
|
|
||||||
return capture.canvas(win, rect.left, rect.top, rect.width, rect.height, {
|
return capture.canvas(win, rect.left, rect.top, rect.width, rect.height);
|
||||||
highlights,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,21 +59,17 @@ capture.element = function(node, highlights = []) {
|
|||||||
* @param {DOMWindow} win
|
* @param {DOMWindow} win
|
||||||
* The DOM window providing the document element to capture,
|
* The DOM window providing the document element to capture,
|
||||||
* and the offsets for the viewport.
|
* and the offsets for the viewport.
|
||||||
* @param {Array.<Node>=} highlights
|
|
||||||
* Optional array of nodes, around which a border will be marked to
|
|
||||||
* highlight them in the screenshot.
|
|
||||||
*
|
*
|
||||||
* @return {HTMLCanvasElement}
|
* @return {HTMLCanvasElement}
|
||||||
* The canvas element where the viewport has been painted on.
|
* The canvas element where the viewport has been painted on.
|
||||||
*/
|
*/
|
||||||
capture.viewport = function(win, highlights = []) {
|
capture.viewport = function(win) {
|
||||||
return capture.canvas(
|
return capture.canvas(
|
||||||
win,
|
win,
|
||||||
win.pageXOffset,
|
win.pageXOffset,
|
||||||
win.pageYOffset,
|
win.pageYOffset,
|
||||||
win.innerWidth,
|
win.innerWidth,
|
||||||
win.innerHeight,
|
win.innerHeight
|
||||||
{ highlights }
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,9 +87,6 @@ capture.viewport = function(win, highlights = []) {
|
|||||||
* The width dimension of the rectangle to paint.
|
* The width dimension of the rectangle to paint.
|
||||||
* @param {number} height
|
* @param {number} height
|
||||||
* The height dimension of the rectangle to paint.
|
* The height dimension of the rectangle to paint.
|
||||||
* @param {Array.<Node>=} highlights
|
|
||||||
* Optional array of nodes, around which a border will be marked to
|
|
||||||
* highlight them in the screenshot.
|
|
||||||
* @param {HTMLCanvasElement=} canvas
|
* @param {HTMLCanvasElement=} canvas
|
||||||
* Optional canvas to reuse for the screenshot.
|
* Optional canvas to reuse for the screenshot.
|
||||||
* @param {number=} flags
|
* @param {number=} flags
|
||||||
@ -115,7 +103,7 @@ capture.canvas = function(
|
|||||||
top,
|
top,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
{ highlights = [], canvas = null, flags = null } = {}
|
{ canvas = null, flags = null } = {}
|
||||||
) {
|
) {
|
||||||
const scale = win.devicePixelRatio;
|
const scale = win.devicePixelRatio;
|
||||||
|
|
||||||
@ -149,49 +137,20 @@ capture.canvas = function(
|
|||||||
let ctx = canvas.getContext(CONTEXT_2D);
|
let ctx = canvas.getContext(CONTEXT_2D);
|
||||||
if (flags === null) {
|
if (flags === null) {
|
||||||
flags = ctx.DRAWWINDOW_DRAW_CARET;
|
flags = ctx.DRAWWINDOW_DRAW_CARET;
|
||||||
// TODO(ato): https://bugzil.la/1377335
|
|
||||||
//
|
// Enabling those flags for drawWindow by default causes
|
||||||
// Disabled in bug 1243415 for webplatform-test
|
// drawing failures. Wait until drawSnapshot is used and supports
|
||||||
// failures due to out of view elements. Needs
|
// these flags (bug 1571341)
|
||||||
// https://github.com/w3c/web-platform-tests/issues/4383 fixed.
|
// ctx.DRAWWINDOW_DRAW_VIEW;
|
||||||
/*
|
// ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
|
||||||
ctx.DRAWWINDOW_DRAW_VIEW;
|
|
||||||
*/
|
|
||||||
// Bug 1009762 - Crash in [@ mozilla::gl::ReadPixelsIntoDataSurface]
|
|
||||||
/*
|
|
||||||
ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.scale(scale, scale);
|
ctx.scale(scale, scale);
|
||||||
ctx.drawWindow(win, left, top, width, height, BG_COLOUR, flags);
|
ctx.drawWindow(win, left, top, width, height, BG_COLOUR, flags);
|
||||||
if (highlights.length) {
|
|
||||||
ctx = capture.highlight_(ctx, highlights, top, left);
|
|
||||||
}
|
|
||||||
|
|
||||||
return canvas;
|
return canvas;
|
||||||
};
|
};
|
||||||
|
|
||||||
capture.highlight_ = function(context, highlights, top = 0, left = 0) {
|
|
||||||
if (typeof highlights == "undefined") {
|
|
||||||
throw new InvalidArgumentError("Missing highlights");
|
|
||||||
}
|
|
||||||
|
|
||||||
context.lineWidth = "2";
|
|
||||||
context.strokeStyle = "red";
|
|
||||||
context.save();
|
|
||||||
|
|
||||||
for (let el of highlights) {
|
|
||||||
let rect = el.getBoundingClientRect();
|
|
||||||
let oy = -top;
|
|
||||||
let ox = -left;
|
|
||||||
|
|
||||||
context.strokeRect(rect.left + ox, rect.top + oy, rect.width, rect.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
return context;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode the contents of an HTMLCanvasElement to a Base64 encoded string.
|
* Encode the contents of an HTMLCanvasElement to a Base64 encoded string.
|
||||||
*
|
*
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
|
|
||||||
<vbox id="things">
|
<vbox id="things">
|
||||||
<checkbox id="testBox" label="box" />
|
<checkbox id="testBox" label="box" />
|
||||||
<textbox id="textInput" size="6" value="test" label="input" />
|
<input xmlns="http://www.w3.org/1999/xhtml" id="textInput" size="6" value="test" label="input" />
|
||||||
<textbox id="textInput2" size="6" value="test" label="input" />
|
<input xmlns="http://www.w3.org/1999/xhtml" id="textInput2" size="6" value="test" label="input" />
|
||||||
<textbox id="textInput3" class="asdf" size="6" value="test" label="input" />
|
<input xmlns="http://www.w3.org/1999/xhtml" id="textInput3" class="asdf" size="6" value="test" label="input" />
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
<iframe id="iframe" name="iframename" src="chrome://marionette/content/test2.xul"/>
|
<iframe id="iframe" name="iframename" src="chrome://marionette/content/test2.xhtml"/>
|
||||||
<iframe id="iframe" name="iframename" src="chrome://marionette/content/test_nested_iframe.xul"/>
|
<iframe id="iframe" name="iframename" src="chrome://marionette/content/test_nested_iframe.xhtml"/>
|
||||||
<hbox id="testXulBox"/>
|
<hbox id="testXulBox"/>
|
||||||
<browser id='aBrowser' src="chrome://marionette/content/test2.xul"/>
|
<browser id='aBrowser' src="chrome://marionette/content/test2.xhtml"/>
|
||||||
</dialog>
|
</dialog>
|
||||||
</window>
|
</window>
|
20
testing/marionette/chrome/test2.xhtml
Normal file
20
testing/marionette/chrome/test2.xhtml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||||
|
|
||||||
|
<!DOCTYPE window [
|
||||||
|
]>
|
||||||
|
|
||||||
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
<dialog id="dia">
|
||||||
|
|
||||||
|
<vbox id="things">
|
||||||
|
<checkbox id="testBox" label="box" />
|
||||||
|
<input xmlns="http://www.w3.org/1999/xhtml" id="textInput" size="6" value="test" label="input" />
|
||||||
|
<input xmlns="http://www.w3.org/1999/xhtml" id="textInput2" size="6" value="test" label="input" />
|
||||||
|
<input xmlns="http://www.w3.org/1999/xhtml" id="textInput3" class="asdf" size="6" value="test" label="input" />
|
||||||
|
</vbox>
|
||||||
|
|
||||||
|
</dialog>
|
||||||
|
</window>
|
@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
||||||
|
|
||||||
<!DOCTYPE window [
|
|
||||||
]>
|
|
||||||
|
|
||||||
<dialog id="dia"
|
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
||||||
|
|
||||||
<vbox id="things">
|
|
||||||
<checkbox id="testBox" label="box" />
|
|
||||||
<textbox id="textInput" size="6" value="test" label="input" />
|
|
||||||
<textbox id="textInput2" size="6" value="test" label="input" />
|
|
||||||
<textbox id="textInput3" class="asdf" size="6" value="test" label="input" />
|
|
||||||
</vbox>
|
|
||||||
|
|
||||||
</dialog>
|
|
@ -1,37 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
||||||
|
|
||||||
<!DOCTYPE dialog [
|
|
||||||
]>
|
|
||||||
|
|
||||||
<dialog id="testDialogAnonymousNode"
|
|
||||||
buttons="accept, cancel"
|
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
||||||
|
|
||||||
<bindings id="testBindings" xmlns="http://www.mozilla.org/xbl"
|
|
||||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
||||||
<binding id="framebox">
|
|
||||||
<content orient="vertical" mousethrough="never">
|
|
||||||
<xul:browser anonid="content" id="browser" flex="1"
|
|
||||||
context="contentAreaContextMenu"
|
|
||||||
src="test.xul"
|
|
||||||
type="content"/>
|
|
||||||
</content>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="iframebox">
|
|
||||||
<content>
|
|
||||||
<xul:box>
|
|
||||||
<xul:iframe anonid="iframe" src="chrome://marionette/content/test.xul"></xul:iframe>
|
|
||||||
</xul:box>
|
|
||||||
</content>
|
|
||||||
</binding>
|
|
||||||
</bindings>
|
|
||||||
|
|
||||||
<hbox id="testAnonymousContentBox"/>
|
|
||||||
<hbox id="container" style="-moz-binding: url('#testBindings');"/>
|
|
||||||
<hbox id="container2" style="-moz-binding: url('#iframebox');"/>
|
|
||||||
|
|
||||||
</dialog>
|
|
@ -11,9 +11,9 @@
|
|||||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||||
|
|
||||||
|
|
||||||
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
|
title="&testDialog.title;">
|
||||||
<dialog id="testDialog"
|
<dialog id="testDialog"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
||||||
title="&testDialog.title;"
|
|
||||||
buttons="accept,cancel">
|
buttons="accept,cancel">
|
||||||
|
|
||||||
<vbox flex="1" style="min-width: 300px; min-height: 500px;">
|
<vbox flex="1" style="min-width: 300px; min-height: 500px;">
|
||||||
@ -29,8 +29,9 @@
|
|||||||
<checkbox id="check-box" label="Test Mode 2" />
|
<checkbox id="check-box" label="Test Mode 2" />
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<label id="text-box-label" control="text-box">Name:</label>
|
<label id="text-box-label" control="text-box">Name:</label>
|
||||||
<textbox id="text-box" flex="1" />
|
<input xmlns="http://www.w3.org/1999/xhtml" id="text-box" style="-moz-box-flex: 1;" />
|
||||||
</hbox>
|
</hbox>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
</dialog>
|
</dialog>
|
||||||
|
</window>
|
@ -6,4 +6,4 @@
|
|||||||
<!DOCTYPE window [
|
<!DOCTYPE window [
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<iframe id="iframe" name="iframename" src="test2.xul"/>
|
<iframe id="iframe" name="iframename" src="test2.xhtml"/>
|
@ -85,42 +85,3 @@ Doing the following will work::
|
|||||||
But this will raise a `NoSuchElementException`::
|
But this will raise a `NoSuchElementException`::
|
||||||
|
|
||||||
client.find_element(By.ID, 'container').find_element(By.ID, 'footer')
|
client.find_element(By.ID, 'container').find_element(By.ID, 'footer')
|
||||||
|
|
||||||
|
|
||||||
Finding Anonymous Nodes
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
When working in chrome scope, for example manipulating the Firefox user
|
|
||||||
interface, you may run into something called an anonymous node.
|
|
||||||
|
|
||||||
Firefox uses a markup language called XUL_ for its interface. XUL is similar
|
|
||||||
to HTML in that it has a DOM and tags that render controls on the display. One
|
|
||||||
ability of XUL is to create re-useable widgets that are made up out of several
|
|
||||||
smaller XUL elements. These widgets can be bound to the DOM using something
|
|
||||||
called the `XML binding language (XBL)`_.
|
|
||||||
|
|
||||||
The end result is that the DOM sees the widget as a single entity. It doesn't
|
|
||||||
know anything about how that widget is made up. All of the smaller XUL elements
|
|
||||||
that make up the widget are called `anonymous content`_. It is not possible to
|
|
||||||
query such elements using traditional DOM methods like `getElementById`.
|
|
||||||
|
|
||||||
Marionette provides two special strategies used for finding anonymous content.
|
|
||||||
Unlike normal elements, anonymous nodes can only be seen by their parent. So
|
|
||||||
it's necessary to first find the parent element and then search for the
|
|
||||||
anonymous children from there.
|
|
||||||
|
|
||||||
* `anon` - Finds all anonymous children of the element, there is no search term
|
|
||||||
so `None` must be passed in::
|
|
||||||
|
|
||||||
anon_children = client.find_element('id', 'parent').find_elements('anon', None)
|
|
||||||
|
|
||||||
* `anon attribute` - Find an anonymous child based on an attribute. An
|
|
||||||
unofficial convention is for anonymous nodes to have an
|
|
||||||
`anonid` attribute::
|
|
||||||
|
|
||||||
anon_child = client.find_element('id', 'parent').find_element('anon attribute', {'anonid': 'container'})
|
|
||||||
|
|
||||||
|
|
||||||
.. _XUL: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL
|
|
||||||
.. _XML binding language (XBL): https://developer.mozilla.org/en-US/docs/XBL
|
|
||||||
.. _anonymous content: https://developer.mozilla.org/en-US/docs/XBL/XBL_1.0_Reference/Anonymous_Content
|
|
||||||
|
@ -25,5 +25,3 @@ class By(object):
|
|||||||
TAG_NAME = "tag name"
|
TAG_NAME = "tag name"
|
||||||
CLASS_NAME = "class name"
|
CLASS_NAME = "class name"
|
||||||
CSS_SELECTOR = "css selector"
|
CSS_SELECTOR = "css selector"
|
||||||
ANON_ATTRIBUTE = "anon attribute"
|
|
||||||
ANON = "anon"
|
|
||||||
|
@ -1677,9 +1677,9 @@ class Marionette(object):
|
|||||||
|
|
||||||
:param method: The method to use to locate the element; one of:
|
:param method: The method to use to locate the element; one of:
|
||||||
"id", "name", "class name", "tag name", "css selector",
|
"id", "name", "class name", "tag name", "css selector",
|
||||||
"link text", "partial link text", "xpath", "anon" and "anon
|
"link text", "partial link text" and "xpath".
|
||||||
attribute". Note that the "name", "link text" and "partial
|
Note that the "name", "link text" and "partial link test"
|
||||||
link test" methods are not supported in the chrome DOM.
|
methods are not supported in the chrome DOM.
|
||||||
:param target: The target of the search. For example, if method =
|
:param target: The target of the search. For example, if method =
|
||||||
"tag", target might equal "div". If method = "id", target would
|
"tag", target might equal "div". If method = "id", target would
|
||||||
be an element id.
|
be an element id.
|
||||||
@ -1707,9 +1707,9 @@ class Marionette(object):
|
|||||||
|
|
||||||
:param method: The method to use to locate the elements; one
|
:param method: The method to use to locate the elements; one
|
||||||
of: "id", "name", "class name", "tag name", "css selector",
|
of: "id", "name", "class name", "tag name", "css selector",
|
||||||
"link text", "partial link text", "xpath", "anon" and "anon
|
"link text", "partial link text" and "xpath".
|
||||||
attribute". Note that the "name", "link text" and "partial link
|
Note that the "name", "link text" and "partial link test"
|
||||||
test" methods are not supported in the chrome DOM.
|
methods are not supported in the chrome DOM.
|
||||||
:param target: The target of the search. For example, if method =
|
:param target: The target of the search. For example, if method =
|
||||||
"tag", target might equal "div". If method = "id", target would be
|
"tag", target might equal "div". If method = "id", target would be
|
||||||
an element id.
|
an element id.
|
||||||
@ -1794,8 +1794,7 @@ class Marionette(object):
|
|||||||
"""
|
"""
|
||||||
return self._send_message("WebDriver:GetCookies")
|
return self._send_message("WebDriver:GetCookies")
|
||||||
|
|
||||||
def save_screenshot(self, fh, element=None, highlights=None,
|
def save_screenshot(self, fh, element=None, full=True, scroll=True):
|
||||||
full=True, scroll=True):
|
|
||||||
"""Takes a screenhot of a web element or the current frame and
|
"""Takes a screenhot of a web element or the current frame and
|
||||||
saves it in the filehandle.
|
saves it in the filehandle.
|
||||||
|
|
||||||
@ -1804,11 +1803,10 @@ class Marionette(object):
|
|||||||
|
|
||||||
The rest of the parameters are defined like in screenshot()
|
The rest of the parameters are defined like in screenshot()
|
||||||
"""
|
"""
|
||||||
data = self.screenshot(element, highlights, "binary", full, scroll)
|
data = self.screenshot(element, "binary", full, scroll)
|
||||||
fh.write(data)
|
fh.write(data)
|
||||||
|
|
||||||
def screenshot(self, element=None, highlights=None, format="base64",
|
def screenshot(self, element=None, format="base64", full=True, scroll=True):
|
||||||
full=True, scroll=True):
|
|
||||||
"""Takes a screenshot of a web element or the current frame.
|
"""Takes a screenshot of a web element or the current frame.
|
||||||
|
|
||||||
The screen capture is returned as a lossless PNG image encoded
|
The screen capture is returned as a lossless PNG image encoded
|
||||||
@ -1820,10 +1818,6 @@ class Marionette(object):
|
|||||||
:param element: The element to take a screenshot of. If None, will
|
:param element: The element to take a screenshot of. If None, will
|
||||||
take a screenshot of the current frame.
|
take a screenshot of the current frame.
|
||||||
|
|
||||||
:param highlights: A list of
|
|
||||||
:class:`~marionette_driver.marionette.HTMLElement` objects to draw
|
|
||||||
a red box around in the returned screenshot.
|
|
||||||
|
|
||||||
:param format: if "base64" (the default), returns the screenshot
|
:param format: if "base64" (the default), returns the screenshot
|
||||||
as a base64-string. If "binary", the data is decoded and
|
as a base64-string. If "binary", the data is decoded and
|
||||||
returned as raw binary. If "hash", the data is hashed using
|
returned as raw binary. If "hash", the data is hashed using
|
||||||
@ -1840,12 +1834,8 @@ class Marionette(object):
|
|||||||
|
|
||||||
if element:
|
if element:
|
||||||
element = element.id
|
element = element.id
|
||||||
lights = None
|
|
||||||
if highlights:
|
|
||||||
lights = [highlight.id for highlight in highlights]
|
|
||||||
|
|
||||||
body = {"id": element,
|
body = {"id": element,
|
||||||
"highlights": lights,
|
|
||||||
"full": full,
|
"full": full,
|
||||||
"hash": False,
|
"hash": False,
|
||||||
"scroll": scroll}
|
"scroll": scroll}
|
||||||
|
@ -430,11 +430,12 @@ class MarionetteParentProcess {
|
|||||||
win.addEventListener(
|
win.addEventListener(
|
||||||
"load",
|
"load",
|
||||||
() => {
|
() => {
|
||||||
if (win.document.getElementById("safeModeDialog")) {
|
let dialog = win.document.getElementById("safeModeDialog");
|
||||||
|
if (dialog) {
|
||||||
// accept the dialog to start in safe-mode
|
// accept the dialog to start in safe-mode
|
||||||
log.trace("Safe mode detected, supressing dialog");
|
log.trace("Safe mode detected, supressing dialog");
|
||||||
win.setTimeout(() => {
|
win.setTimeout(() => {
|
||||||
win.document.documentElement.getButton("accept").click();
|
dialog.getButton("accept").click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -26,10 +26,6 @@ element.findByPartialLinkText
|
|||||||
-----------------------------
|
-----------------------------
|
||||||
.. js:autofunction:: element.findByPartialLinkText
|
.. js:autofunction:: element.findByPartialLinkText
|
||||||
|
|
||||||
element.findAnonymousNodes
|
|
||||||
----------------------------
|
|
||||||
.. js:autofunction:: element.findAnonymousNodes
|
|
||||||
|
|
||||||
element.findClosest
|
element.findClosest
|
||||||
-------------------
|
-------------------
|
||||||
.. js:autofunction:: element.findClosest
|
.. js:autofunction:: element.findClosest
|
||||||
|
@ -98,8 +98,6 @@ const SUPPORTED_STRATEGIES = new Set([
|
|||||||
element.Strategy.ID,
|
element.Strategy.ID,
|
||||||
element.Strategy.TagName,
|
element.Strategy.TagName,
|
||||||
element.Strategy.XPath,
|
element.Strategy.XPath,
|
||||||
element.Strategy.Anon,
|
|
||||||
element.Strategy.AnonAttribute,
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Timeout used to abort fullscreen, maximize, and minimize
|
// Timeout used to abort fullscreen, maximize, and minimize
|
||||||
@ -1800,37 +1798,6 @@ GeckoDriver.prototype.switchToFrame = async function(cmd) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the frame is XBL anonymous
|
|
||||||
let parent = curWindow.document.getBindingParent(wantedFrame);
|
|
||||||
// Shadow nodes also show up in getAnonymousNodes, we should
|
|
||||||
// ignore them.
|
|
||||||
if (
|
|
||||||
parent &&
|
|
||||||
!(parent.shadowRoot && parent.shadowRoot.contains(wantedFrame))
|
|
||||||
) {
|
|
||||||
const doc = curWindow.document;
|
|
||||||
let anonNodes = [...(doc.getAnonymousNodes(parent) || [])];
|
|
||||||
if (anonNodes.length > 0) {
|
|
||||||
let el = wantedFrame;
|
|
||||||
while (el) {
|
|
||||||
if (anonNodes.indexOf(el) > -1) {
|
|
||||||
curWindow = wantedFrame.contentWindow;
|
|
||||||
this.curFrame = curWindow;
|
|
||||||
if (focus) {
|
|
||||||
this.curFrame.focus();
|
|
||||||
}
|
|
||||||
checkTimer.initWithCallback(
|
|
||||||
checkLoad.bind(this),
|
|
||||||
100,
|
|
||||||
Ci.nsITimer.TYPE_ONE_SHOT
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
el = el.parentNode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// else, assume iframe
|
// else, assume iframe
|
||||||
let frames = curWindow.document.getElementsByTagName("iframe");
|
let frames = curWindow.document.getElementsByTagName("iframe");
|
||||||
let numFrames = frames.length;
|
let numFrames = frames.length;
|
||||||
@ -2656,7 +2623,7 @@ GeckoDriver.prototype.clearElement = async function(cmd) {
|
|||||||
case Context.Chrome:
|
case Context.Chrome:
|
||||||
// the selenium atom doesn't work here
|
// the selenium atom doesn't work here
|
||||||
let el = this.curBrowser.seenEls.get(webEl);
|
let el = this.curBrowser.seenEls.get(webEl);
|
||||||
if (el.nodeName == "textbox") {
|
if (el.nodeName == "input" && el.type == "text") {
|
||||||
el.value = "";
|
el.value = "";
|
||||||
} else if (el.nodeName == "checkbox") {
|
} else if (el.nodeName == "checkbox") {
|
||||||
el.checked = false;
|
el.checked = false;
|
||||||
@ -2997,16 +2964,13 @@ GeckoDriver.prototype.deleteSession = function() {
|
|||||||
* @param {string=} id
|
* @param {string=} id
|
||||||
* Optional web element reference to take a screenshot of.
|
* Optional web element reference to take a screenshot of.
|
||||||
* If undefined, a screenshot will be taken of the document element.
|
* If undefined, a screenshot will be taken of the document element.
|
||||||
* @param {Array.<string>=} highlights
|
* @param {boolean=} full
|
||||||
* List of web elements to highlight.
|
* True to take a screenshot of the entire document element. Is only
|
||||||
* @param {boolean} full
|
|
||||||
* True to take a screenshot of the entire document element. Is not
|
|
||||||
* considered if <var>id</var> is not defined. Defaults to true.
|
* considered if <var>id</var> is not defined. Defaults to true.
|
||||||
* @param {boolean=} hash
|
* @param {boolean=} hash
|
||||||
* True if the user requests a hash of the image data.
|
* True if the user requests a hash of the image data. Defaults to false.
|
||||||
* @param {boolean=} scroll
|
* @param {boolean=} scroll
|
||||||
* Scroll to element if |id| is provided. If undefined, it will
|
* Scroll to element if |id| is provided. Defaults to true.
|
||||||
* scroll to the element.
|
|
||||||
*
|
*
|
||||||
* @return {string}
|
* @return {string}
|
||||||
* If <var>hash</var> is false, PNG image encoded as Base64 encoded
|
* If <var>hash</var> is false, PNG image encoded as Base64 encoded
|
||||||
@ -3016,23 +2980,21 @@ GeckoDriver.prototype.deleteSession = function() {
|
|||||||
GeckoDriver.prototype.takeScreenshot = function(cmd) {
|
GeckoDriver.prototype.takeScreenshot = function(cmd) {
|
||||||
let win = assert.open(this.getCurrentWindow());
|
let win = assert.open(this.getCurrentWindow());
|
||||||
|
|
||||||
let { id, highlights, full, hash } = cmd.parameters;
|
let { id, full, hash, scroll } = cmd.parameters;
|
||||||
highlights = highlights || [];
|
|
||||||
let format = hash ? capture.Format.Hash : capture.Format.Base64;
|
let format = hash ? capture.Format.Hash : capture.Format.Base64;
|
||||||
|
|
||||||
|
full = typeof full == "undefined" ? true : full;
|
||||||
|
scroll = typeof scroll == "undefined" ? true : scroll;
|
||||||
|
|
||||||
|
// Only consider full screenshot if no element has been specified
|
||||||
|
full = id ? false : full;
|
||||||
|
|
||||||
switch (this.context) {
|
switch (this.context) {
|
||||||
case Context.Chrome:
|
case Context.Chrome:
|
||||||
let highlightEls = highlights
|
|
||||||
.map(ref => WebElement.fromUUID(ref, Context.Chrome))
|
|
||||||
.map(webEl => this.curBrowser.seenEls.get(webEl));
|
|
||||||
|
|
||||||
// viewport
|
|
||||||
let canvas;
|
let canvas;
|
||||||
if (!id && !full) {
|
|
||||||
canvas = capture.viewport(win, highlightEls);
|
|
||||||
|
|
||||||
// element or full document element
|
// element or full document element
|
||||||
} else {
|
if (id || full) {
|
||||||
let node;
|
let node;
|
||||||
if (id) {
|
if (id) {
|
||||||
let webEl = WebElement.fromUUID(id, Context.Chrome);
|
let webEl = WebElement.fromUUID(id, Context.Chrome);
|
||||||
@ -3041,7 +3003,11 @@ GeckoDriver.prototype.takeScreenshot = function(cmd) {
|
|||||||
node = win.document.documentElement;
|
node = win.document.documentElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas = capture.element(node, highlightEls);
|
canvas = capture.element(node);
|
||||||
|
|
||||||
|
// viewport
|
||||||
|
} else {
|
||||||
|
canvas = capture.viewport(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
@ -3054,7 +3020,11 @@ GeckoDriver.prototype.takeScreenshot = function(cmd) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Context.Content:
|
case Context.Content:
|
||||||
return this.listener.takeScreenshot(format, cmd.parameters);
|
return this.listener.takeScreenshot(format, {
|
||||||
|
id,
|
||||||
|
full,
|
||||||
|
scroll,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new TypeError(`Unknown context: ${this.context}`);
|
throw new TypeError(`Unknown context: ${this.context}`);
|
||||||
|
@ -82,8 +82,6 @@ element.Strategy = {
|
|||||||
PartialLinkText: "partial link text",
|
PartialLinkText: "partial link text",
|
||||||
TagName: "tag name",
|
TagName: "tag name",
|
||||||
XPath: "xpath",
|
XPath: "xpath",
|
||||||
Anon: "anon",
|
|
||||||
AnonAttribute: "anon attribute",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -329,17 +327,7 @@ element.find = function(container, strategy, selector, opts = {}) {
|
|||||||
// the following code ought to be moved into findElement
|
// the following code ought to be moved into findElement
|
||||||
// and findElements when bug 1254486 is addressed
|
// and findElements when bug 1254486 is addressed
|
||||||
if (!opts.all && (!foundEls || foundEls.length == 0)) {
|
if (!opts.all && (!foundEls || foundEls.length == 0)) {
|
||||||
let msg;
|
let msg = `Unable to locate element: ${selector}`;
|
||||||
switch (strategy) {
|
|
||||||
case element.Strategy.AnonAttribute:
|
|
||||||
msg =
|
|
||||||
"Unable to locate anonymous element: " + JSON.stringify(selector);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
msg = "Unable to locate element: " + selector;
|
|
||||||
}
|
|
||||||
|
|
||||||
reject(new NoSuchElementError(msg));
|
reject(new NoSuchElementError(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,20 +349,8 @@ function find_(
|
|||||||
let rootNode = container.shadowRoot || container.frame.document;
|
let rootNode = container.shadowRoot || container.frame.document;
|
||||||
|
|
||||||
if (!startNode) {
|
if (!startNode) {
|
||||||
switch (strategy) {
|
|
||||||
// For anonymous nodes the start node needs to be of type
|
|
||||||
// DOMElement, which will refer to :root in case of a DOMDocument.
|
|
||||||
case element.Strategy.Anon:
|
|
||||||
case element.Strategy.AnonAttribute:
|
|
||||||
if (rootNode.nodeType == rootNode.DOCUMENT_NODE) {
|
|
||||||
startNode = rootNode.documentElement;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
startNode = rootNode;
|
startNode = rootNode;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let res;
|
let res;
|
||||||
try {
|
try {
|
||||||
@ -484,24 +460,6 @@ element.findByPartialLinkText = function(startNode, linkText) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Find anonymous nodes of <var>node</var>.
|
|
||||||
*
|
|
||||||
* @param {XULDocument} document
|
|
||||||
* Root node of the document.
|
|
||||||
* @param {XULElement} node
|
|
||||||
* Where in the DOM hierarchy to begin searching.
|
|
||||||
*
|
|
||||||
* @return {Iterable.<XULElement>}
|
|
||||||
* Iterator over anonymous elements.
|
|
||||||
*/
|
|
||||||
element.findAnonymousNodes = function*(document, node) {
|
|
||||||
let anons = document.getAnonymousNodes(node) || [];
|
|
||||||
for (let node of anons) {
|
|
||||||
yield node;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters all hyperlinks that are descendant of <var>startNode</var>
|
* Filters all hyperlinks that are descendant of <var>startNode</var>
|
||||||
* by <var>predicate</var>.
|
* by <var>predicate</var>.
|
||||||
@ -592,17 +550,6 @@ function findElement(strategy, selector, document, startNode = undefined) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new InvalidSelectorError(`${e.message}: "${selector}"`);
|
throw new InvalidSelectorError(`${e.message}: "${selector}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
case element.Strategy.Anon:
|
|
||||||
return element.findAnonymousNodes(document, startNode).next().value;
|
|
||||||
|
|
||||||
case element.Strategy.AnonAttribute:
|
|
||||||
let attr = Object.keys(selector)[0];
|
|
||||||
return document.getAnonymousElementByAttribute(
|
|
||||||
startNode,
|
|
||||||
attr,
|
|
||||||
selector[attr]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidSelectorError(`No such strategy: ${strategy}`);
|
throw new InvalidSelectorError(`No such strategy: ${strategy}`);
|
||||||
@ -664,21 +611,6 @@ function findElements(strategy, selector, document, startNode = undefined) {
|
|||||||
case element.Strategy.Selector:
|
case element.Strategy.Selector:
|
||||||
return startNode.querySelectorAll(selector);
|
return startNode.querySelectorAll(selector);
|
||||||
|
|
||||||
case element.Strategy.Anon:
|
|
||||||
return [...element.findAnonymousNodes(document, startNode)];
|
|
||||||
|
|
||||||
case element.Strategy.AnonAttribute:
|
|
||||||
let attr = Object.keys(selector)[0];
|
|
||||||
let el = document.getAnonymousElementByAttribute(
|
|
||||||
startNode,
|
|
||||||
attr,
|
|
||||||
selector[attr]
|
|
||||||
);
|
|
||||||
if (el) {
|
|
||||||
return [el];
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidSelectorError(`No such strategy: ${strategy}`);
|
throw new InvalidSelectorError(`No such strategy: ${strategy}`);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ from .marionette_test import (
|
|||||||
skip_if_chrome,
|
skip_if_chrome,
|
||||||
skip_if_desktop,
|
skip_if_desktop,
|
||||||
skip_if_e10s,
|
skip_if_e10s,
|
||||||
skip_if_mobile,
|
|
||||||
SkipTest,
|
SkipTest,
|
||||||
skip_unless_protocol,
|
skip_unless_protocol,
|
||||||
)
|
)
|
||||||
|
@ -19,7 +19,6 @@ from .decorators import (
|
|||||||
skip_if_chrome,
|
skip_if_chrome,
|
||||||
skip_if_desktop,
|
skip_if_desktop,
|
||||||
skip_if_e10s,
|
skip_if_e10s,
|
||||||
skip_if_mobile,
|
|
||||||
skip_unless_browser_pref,
|
skip_unless_browser_pref,
|
||||||
skip_unless_protocol,
|
skip_unless_protocol,
|
||||||
with_parameters,
|
with_parameters,
|
||||||
|
@ -139,21 +139,6 @@ def skip_if_e10s(reason):
|
|||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def skip_if_mobile(reason):
|
|
||||||
"""Decorator which skips a test if run on mobile."""
|
|
||||||
def decorator(test_item):
|
|
||||||
if not isinstance(test_item, types.FunctionType):
|
|
||||||
raise Exception('Decorator only supported for functions')
|
|
||||||
|
|
||||||
@functools.wraps(test_item)
|
|
||||||
def skip_wrapper(self, *args, **kwargs):
|
|
||||||
if self.marionette.session_capabilities.get('browserName') == 'fennec':
|
|
||||||
raise SkipTest(reason)
|
|
||||||
return test_item(self, *args, **kwargs)
|
|
||||||
return skip_wrapper
|
|
||||||
return decorator
|
|
||||||
|
|
||||||
|
|
||||||
def skip_unless_browser_pref(reason, pref, predicate=bool):
|
def skip_unless_browser_pref(reason, pref, predicate=bool):
|
||||||
"""Decorator which skips a test based on the value of a browser preference.
|
"""Decorator which skips a test based on the value of a browser preference.
|
||||||
|
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
from marionette_driver.by import By
|
|
||||||
from marionette_driver.errors import NoSuchElementException
|
|
||||||
from marionette_driver.marionette import HTMLElement
|
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
|
||||||
|
|
||||||
|
|
||||||
class TestAnonymousNodes(WindowManagerMixin, MarionetteTestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(TestAnonymousNodes, self).setUp()
|
|
||||||
self.marionette.set_context("chrome")
|
|
||||||
|
|
||||||
url = "chrome://marionette/content/test_anonymous_content.xul"
|
|
||||||
new_window = self.open_chrome_window(url)
|
|
||||||
self.marionette.switch_to_window(new_window)
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.close_all_windows()
|
|
||||||
|
|
||||||
super(TestAnonymousNodes, self).tearDown()
|
|
||||||
|
|
||||||
def test_switch_to_anonymous_frame(self):
|
|
||||||
self.marionette.find_element(By.ID, "testAnonymousContentBox")
|
|
||||||
anon_browser_el = self.marionette.find_element(By.ID, "browser")
|
|
||||||
self.assertTrue("test_anonymous_content.xul" in self.marionette.get_url())
|
|
||||||
self.marionette.switch_to_frame(anon_browser_el)
|
|
||||||
self.assertTrue("test.xul" in self.marionette.get_url())
|
|
||||||
self.marionette.find_element(By.ID, "testXulBox")
|
|
||||||
self.assertRaises(NoSuchElementException,
|
|
||||||
self.marionette.find_element, By.ID, "testAnonymousContentBox")
|
|
||||||
|
|
||||||
def test_switch_to_anonymous_iframe(self):
|
|
||||||
self.marionette.find_element(By.ID, "testAnonymousContentBox")
|
|
||||||
el = self.marionette.find_element(By.ID, "container2")
|
|
||||||
anon_iframe_el = el.find_element(By.ANON_ATTRIBUTE, {"anonid": "iframe"})
|
|
||||||
self.marionette.switch_to_frame(anon_iframe_el)
|
|
||||||
self.assertTrue("test.xul" in self.marionette.get_url())
|
|
||||||
self.marionette.find_element(By.ID, "testXulBox")
|
|
||||||
self.assertRaises(NoSuchElementException, self.marionette.find_element, By.ID,
|
|
||||||
"testAnonymousContentBox")
|
|
||||||
|
|
||||||
def test_find_anonymous_element_by_attribute(self):
|
|
||||||
accept_button = (By.ANON_ATTRIBUTE, {"dlgtype": "accept"},)
|
|
||||||
not_existent = (By.ANON_ATTRIBUTE, {"anonid": "notexistent"},)
|
|
||||||
|
|
||||||
# By using the window document element
|
|
||||||
start_node = self.marionette.find_element(By.CSS_SELECTOR, ":root")
|
|
||||||
button = start_node.find_element(*accept_button)
|
|
||||||
self.assertEquals(HTMLElement, type(button))
|
|
||||||
with self.assertRaises(NoSuchElementException):
|
|
||||||
start_node.find_element(*not_existent)
|
|
||||||
|
|
||||||
# By using the default start node
|
|
||||||
self.assertEquals(button, self.marionette.find_element(*accept_button))
|
|
||||||
with self.assertRaises(NoSuchElementException):
|
|
||||||
self.marionette.find_element(*not_existent)
|
|
||||||
|
|
||||||
def test_find_anonymous_elements_by_attribute(self):
|
|
||||||
dialog_buttons = (By.ANON_ATTRIBUTE, {"anonid": "buttons"},)
|
|
||||||
not_existent = (By.ANON_ATTRIBUTE, {"anonid": "notexistent"},)
|
|
||||||
|
|
||||||
# By using the window document element
|
|
||||||
start_node = self.marionette.find_element(By.CSS_SELECTOR, ":root")
|
|
||||||
buttons = start_node.find_elements(*dialog_buttons)
|
|
||||||
self.assertEquals(1, len(buttons))
|
|
||||||
self.assertEquals(HTMLElement, type(buttons[0]))
|
|
||||||
self.assertListEqual([], start_node.find_elements(*not_existent))
|
|
||||||
|
|
||||||
# By using the default start node
|
|
||||||
self.assertListEqual(buttons, self.marionette.find_elements(*dialog_buttons))
|
|
||||||
self.assertListEqual([], self.marionette.find_elements(*not_existent))
|
|
||||||
|
|
||||||
def test_find_anonymous_children(self):
|
|
||||||
self.assertEquals(HTMLElement, type(self.marionette.find_element(By.ANON, None)))
|
|
||||||
self.assertEquals(3, len(self.marionette.find_elements(By.ANON, None)))
|
|
||||||
|
|
||||||
frame = self.marionette.find_element(By.ID, "framebox")
|
|
||||||
with self.assertRaises(NoSuchElementException):
|
|
||||||
frame.find_element(By.ANON, None)
|
|
||||||
self.assertListEqual([], frame.find_elements(By.ANON, None))
|
|
@ -16,7 +16,7 @@ class TestSelectedChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -12,7 +12,6 @@ from marionette_driver.marionette import Alert
|
|||||||
from marionette_harness import (
|
from marionette_harness import (
|
||||||
MarionetteTestCase,
|
MarionetteTestCase,
|
||||||
run_if_e10s,
|
run_if_e10s,
|
||||||
skip_if_mobile,
|
|
||||||
WindowManagerMixin,
|
WindowManagerMixin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -453,7 +452,6 @@ class TestClickCloseContext(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.marionette.navigate(self.test_page)
|
self.marionette.navigate(self.test_page)
|
||||||
self.marionette.find_element(By.ID, "close-window").click()
|
self.marionette.find_element(By.ID, "close-window").click()
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_click_close_window(self):
|
def test_click_close_window(self):
|
||||||
new_tab = self.open_window()
|
new_tab = self.open_window()
|
||||||
self.marionette.switch_to_window(new_tab)
|
self.marionette.switch_to_window(new_tab)
|
||||||
|
@ -22,7 +22,7 @@ class TestClickChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
super(TestClickChrome, self).tearDown()
|
super(TestClickChrome, self).tearDown()
|
||||||
|
|
||||||
def test_click(self):
|
def test_click(self):
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
def checked():
|
def checked():
|
||||||
|
@ -16,7 +16,7 @@ class TestElementState(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
self.win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
self.win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(self.win)
|
self.marionette.switch_to_window(self.win)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -16,7 +16,7 @@ class TestElementSizeChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test2.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test2.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -6,7 +6,7 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
from marionette_driver.errors import JavascriptException
|
from marionette_driver.errors import JavascriptException
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, skip_if_mobile
|
from marionette_harness import MarionetteTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestExecuteSandboxes(MarionetteTestCase):
|
class TestExecuteSandboxes(MarionetteTestCase):
|
||||||
@ -41,7 +41,6 @@ class TestExecuteSandboxes(MarionetteTestCase):
|
|||||||
"return foo", sandbox="2", new_sandbox=False)
|
"return foo", sandbox="2", new_sandbox=False)
|
||||||
self.assertEqual(foo, 2)
|
self.assertEqual(foo, 2)
|
||||||
|
|
||||||
@skip_if_mobile("Intermittent on Android - bug 1526914")
|
|
||||||
def test_execute_new_sandbox(self):
|
def test_execute_new_sandbox(self):
|
||||||
# test that clearing a sandbox does not affect other sandboxes
|
# test that clearing a sandbox does not affect other sandboxes
|
||||||
self.marionette.execute_script("foo = 1", sandbox="1")
|
self.marionette.execute_script("foo = 1", sandbox="1")
|
||||||
|
@ -7,7 +7,7 @@ from marionette_driver import By, errors
|
|||||||
from marionette_driver.marionette import Alert, HTMLElement
|
from marionette_driver.marionette import Alert, HTMLElement
|
||||||
from marionette_driver.wait import Wait
|
from marionette_driver.wait import Wait
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
|
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
||||||
|
|
||||||
|
|
||||||
def inline(doc):
|
def inline(doc):
|
||||||
@ -351,7 +351,6 @@ class TestExecuteContent(MarionetteTestCase):
|
|||||||
def test_comment_in_last_line(self):
|
def test_comment_in_last_line(self):
|
||||||
self.marionette.execute_script(" // comment ")
|
self.marionette.execute_script(" // comment ")
|
||||||
|
|
||||||
@skip_if_mobile("Modal dialogs not supported in Fennec")
|
|
||||||
def test_return_value_on_alert(self):
|
def test_return_value_on_alert(self):
|
||||||
res = self.marionette._send_message("WebDriver:ExecuteScript", {"script": "alert()"})
|
res = self.marionette._send_message("WebDriver:ExecuteScript", {"script": "alert()"})
|
||||||
self.assertIn("value", res)
|
self.assertIn("value", res)
|
||||||
@ -372,15 +371,15 @@ class TestExecuteChrome(WindowManagerMixin, TestExecuteContent):
|
|||||||
self.marionette.execute_script(
|
self.marionette.execute_script(
|
||||||
"Components.classes['@mozilla.org/preferences-service;1']")
|
"Components.classes['@mozilla.org/preferences-service;1']")
|
||||||
|
|
||||||
@skip_if_mobile("New windows not supported in Fennec")
|
|
||||||
def test_unmarshal_element_collection(self):
|
def test_unmarshal_element_collection(self):
|
||||||
try:
|
try:
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
expected = self.marionette.find_elements(By.TAG_NAME, "textbox")
|
expected = self.marionette.find_elements(By.TAG_NAME, "input")
|
||||||
actual = self.marionette.execute_script(
|
actual = self.marionette.execute_script(
|
||||||
"return document.querySelectorAll('textbox')")
|
"return document.querySelectorAll('input')")
|
||||||
|
self.assertTrue(len(expected) > 0)
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
@ -18,7 +18,7 @@ class TestElementsChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
@ -41,14 +41,14 @@ class TestElementsChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
def test_child_element(self):
|
def test_child_element(self):
|
||||||
el = self.marionette.find_element(By.ID, "textInput")
|
el = self.marionette.find_element(By.ID, "textInput")
|
||||||
parent = self.marionette.find_element(By.ID, "things")
|
parent = self.marionette.find_element(By.ID, "things")
|
||||||
found_el = parent.find_element(By.TAG_NAME, "textbox")
|
found_el = parent.find_element(By.TAG_NAME, "input")
|
||||||
self.assertEqual(HTMLElement, type(found_el))
|
self.assertEqual(HTMLElement, type(found_el))
|
||||||
self.assertEqual(el, found_el)
|
self.assertEqual(el, found_el)
|
||||||
|
|
||||||
def test_child_elements(self):
|
def test_child_elements(self):
|
||||||
el = self.marionette.find_element(By.ID, "textInput3")
|
el = self.marionette.find_element(By.ID, "textInput3")
|
||||||
parent = self.marionette.find_element(By.ID, "things")
|
parent = self.marionette.find_element(By.ID, "things")
|
||||||
found_els = parent.find_elements(By.TAG_NAME, "textbox")
|
found_els = parent.find_elements(By.TAG_NAME, "input")
|
||||||
self.assertTrue(el.id in [found_el.id for found_el in found_els])
|
self.assertTrue(el.id in [found_el.id for found_el in found_els])
|
||||||
|
|
||||||
def test_tag_name(self):
|
def test_tag_name(self):
|
||||||
@ -85,7 +85,7 @@ class TestElementsChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.marionette.timeout.implicit = 4
|
self.marionette.timeout.implicit = 4
|
||||||
self.marionette.execute_script("""
|
self.marionette.execute_script("""
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
var b = window.document.createElement('button');
|
var b = window.document.createXULElement('button');
|
||||||
b.id = 'myid';
|
b.id = 'myid';
|
||||||
document.getElementById('things').appendChild(b);
|
document.getElementById('things').appendChild(b);
|
||||||
}, 1000); """)
|
}, 1000); """)
|
||||||
|
@ -6,7 +6,7 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
from marionette_driver.errors import NoSuchWindowException
|
from marionette_driver.errors import NoSuchWindowException
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, WindowManagerMixin, skip_if_mobile
|
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
||||||
|
|
||||||
|
|
||||||
class TestGetCurrentUrlChrome(WindowManagerMixin, MarionetteTestCase):
|
class TestGetCurrentUrlChrome(WindowManagerMixin, MarionetteTestCase):
|
||||||
@ -29,9 +29,8 @@ class TestGetCurrentUrlChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
chrome_url = self.marionette.execute_script("return window.location.href;")
|
chrome_url = self.marionette.execute_script("return window.location.href;")
|
||||||
self.assertEqual(self.marionette.get_url(), chrome_url)
|
self.assertEqual(self.marionette.get_url(), chrome_url)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_no_browser_window(self):
|
def test_no_browser_window(self):
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
chrome_url = self.marionette.execute_script("return window.location.href;")
|
chrome_url = self.marionette.execute_script("return window.location.href;")
|
||||||
|
@ -9,7 +9,7 @@ import time
|
|||||||
|
|
||||||
from marionette_driver import errors
|
from marionette_driver import errors
|
||||||
from marionette_driver.marionette import Marionette
|
from marionette_driver.marionette import Marionette
|
||||||
from marionette_harness import MarionetteTestCase, run_if_manage_instance, skip_if_mobile
|
from marionette_harness import MarionetteTestCase, run_if_manage_instance
|
||||||
|
|
||||||
|
|
||||||
class TestMarionette(MarionetteTestCase):
|
class TestMarionette(MarionetteTestCase):
|
||||||
@ -25,7 +25,6 @@ class TestMarionette(MarionetteTestCase):
|
|||||||
self.assertIn(expected_test_name, self.marionette.test_name)
|
self.assertIn(expected_test_name, self.marionette.test_name)
|
||||||
|
|
||||||
@run_if_manage_instance("Only runnable if Marionette manages the instance")
|
@run_if_manage_instance("Only runnable if Marionette manages the instance")
|
||||||
@skip_if_mobile("Bug 1322993 - Missing temporary folder")
|
|
||||||
def test_raise_for_port_non_existing_process(self):
|
def test_raise_for_port_non_existing_process(self):
|
||||||
"""Test that raise_for_port doesn't run into a timeout if instance is not running."""
|
"""Test that raise_for_port doesn't run into a timeout if instance is not running."""
|
||||||
self.marionette.quit()
|
self.marionette.quit()
|
||||||
@ -61,7 +60,6 @@ class TestMarionette(MarionetteTestCase):
|
|||||||
self.assertEqual(current_socket_timeout,
|
self.assertEqual(current_socket_timeout,
|
||||||
self.marionette.client._sock.gettimeout())
|
self.marionette.client._sock.gettimeout())
|
||||||
|
|
||||||
@skip_if_mobile("No application update service available on Android")
|
|
||||||
def test_application_update_disabled(self):
|
def test_application_update_disabled(self):
|
||||||
# Updates of the application should always be disabled by default
|
# Updates of the application should always be disabled by default
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
|
@ -9,7 +9,7 @@ import urllib
|
|||||||
from marionette_driver import By, errors, Wait
|
from marionette_driver import By, errors, Wait
|
||||||
from marionette_driver.keys import Keys
|
from marionette_driver.keys import Keys
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, skip_if_mobile
|
from marionette_harness import MarionetteTestCase
|
||||||
|
|
||||||
|
|
||||||
def inline(doc):
|
def inline(doc):
|
||||||
@ -78,7 +78,6 @@ class TestPointerActions(BaseMouseAction):
|
|||||||
event_count = self.marionette.execute_script("return window.eventCount", sandbox=None)
|
event_count = self.marionette.execute_script("return window.eventCount", sandbox=None)
|
||||||
self.assertEqual(event_count, 2)
|
self.assertEqual(event_count, 2)
|
||||||
|
|
||||||
@skip_if_mobile("There is no context menu available on mobile")
|
|
||||||
def test_context_click_action(self):
|
def test_context_click_action(self):
|
||||||
test_html = self.marionette.absolute_url("clicks.html")
|
test_html = self.marionette.absolute_url("clicks.html")
|
||||||
self.marionette.navigate(test_html)
|
self.marionette.navigate(test_html)
|
||||||
@ -151,7 +150,6 @@ class TestNonSpecCompliantPointerOrigin(BaseMouseAction):
|
|||||||
self.assertAlmostEqual(click_position["x"], elem_center_point["x"], delta=1)
|
self.assertAlmostEqual(click_position["x"], elem_center_point["x"], delta=1)
|
||||||
self.assertAlmostEqual(click_position["y"], elem_center_point["y"], delta=1)
|
self.assertAlmostEqual(click_position["y"], elem_center_point["y"], delta=1)
|
||||||
|
|
||||||
@skip_if_mobile("Bug 1534291 - Missing MoveTargetOutOfBoundsException")
|
|
||||||
def test_click_element_larger_than_viewport_with_center_point_outside(self):
|
def test_click_element_larger_than_viewport_with_center_point_outside(self):
|
||||||
self.marionette.navigate(inline("""
|
self.marionette.navigate(inline("""
|
||||||
<div id="div" style="width: 300vw; height: 300vh; background: green;"
|
<div id="div" style="width: 300vw; height: 300vh; background: green;"
|
||||||
|
@ -15,7 +15,6 @@ from marionette_harness import (
|
|||||||
MarionetteTestCase,
|
MarionetteTestCase,
|
||||||
run_if_e10s,
|
run_if_e10s,
|
||||||
run_if_manage_instance,
|
run_if_manage_instance,
|
||||||
skip_if_mobile,
|
|
||||||
WindowManagerMixin,
|
WindowManagerMixin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -258,14 +257,12 @@ class TestNavigate(BaseNavigationTestCase):
|
|||||||
self.marionette.go_back()
|
self.marionette.go_back()
|
||||||
self.assertEqual(self.marionette.get_url(), self.test_page_push_state)
|
self.assertEqual(self.marionette.get_url(), self.test_page_push_state)
|
||||||
|
|
||||||
@skip_if_mobile("Test file is only located on host machine")
|
|
||||||
def test_navigate_file_url(self):
|
def test_navigate_file_url(self):
|
||||||
self.marionette.navigate(self.test_page_file_url)
|
self.marionette.navigate(self.test_page_file_url)
|
||||||
self.marionette.find_element(By.ID, "file-url")
|
self.marionette.find_element(By.ID, "file-url")
|
||||||
self.marionette.navigate(self.test_page_remote)
|
self.marionette.navigate(self.test_page_remote)
|
||||||
|
|
||||||
@run_if_e10s("Requires e10s mode enabled")
|
@run_if_e10s("Requires e10s mode enabled")
|
||||||
@skip_if_mobile("Test file is only located on host machine")
|
|
||||||
def test_navigate_file_url_remoteness_change(self):
|
def test_navigate_file_url_remoteness_change(self):
|
||||||
self.marionette.navigate("about:robots")
|
self.marionette.navigate("about:robots")
|
||||||
self.assertFalse(self.is_remote_tab)
|
self.assertFalse(self.is_remote_tab)
|
||||||
@ -283,7 +280,6 @@ class TestNavigate(BaseNavigationTestCase):
|
|||||||
self.marionette.navigate("about:blank")
|
self.marionette.navigate("about:blank")
|
||||||
|
|
||||||
@run_if_manage_instance("Only runnable if Marionette manages the instance")
|
@run_if_manage_instance("Only runnable if Marionette manages the instance")
|
||||||
@skip_if_mobile("Bug 1322993 - Missing temporary folder")
|
|
||||||
def test_focus_after_navigation(self):
|
def test_focus_after_navigation(self):
|
||||||
self.marionette.restart()
|
self.marionette.restart()
|
||||||
|
|
||||||
@ -299,13 +295,12 @@ class TestNavigate(BaseNavigationTestCase):
|
|||||||
self.marionette.switch_to_window(self.new_tab)
|
self.marionette.switch_to_window(self.new_tab)
|
||||||
self.marionette.navigate(self.test_page_remote)
|
self.marionette.navigate(self.test_page_remote)
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome elements not available for Fennec")
|
|
||||||
def test_type_to_non_remote_tab(self):
|
def test_type_to_non_remote_tab(self):
|
||||||
self.marionette.navigate(self.test_page_not_remote)
|
self.marionette.navigate(self.test_page_not_remote)
|
||||||
self.assertFalse(self.is_remote_tab)
|
self.assertFalse(self.is_remote_tab)
|
||||||
|
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
urlbar = self.marionette.find_element(By.ID, "urlbar")
|
urlbar = self.marionette.find_element(By.ID, "urlbar-input")
|
||||||
urlbar.send_keys(self.mod_key + "a")
|
urlbar.send_keys(self.mod_key + "a")
|
||||||
urlbar.send_keys(self.mod_key + "x")
|
urlbar.send_keys(self.mod_key + "x")
|
||||||
urlbar.send_keys("about:support" + Keys.ENTER)
|
urlbar.send_keys("about:support" + Keys.ENTER)
|
||||||
@ -315,13 +310,12 @@ class TestNavigate(BaseNavigationTestCase):
|
|||||||
message="'about:support' hasn't been loaded")
|
message="'about:support' hasn't been loaded")
|
||||||
self.assertFalse(self.is_remote_tab)
|
self.assertFalse(self.is_remote_tab)
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome elements not available for Fennec")
|
|
||||||
@run_if_e10s("Requires e10s mode enabled")
|
@run_if_e10s("Requires e10s mode enabled")
|
||||||
def test_type_to_remote_tab(self):
|
def test_type_to_remote_tab(self):
|
||||||
self.assertTrue(self.is_remote_tab)
|
self.assertTrue(self.is_remote_tab)
|
||||||
|
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
urlbar = self.marionette.find_element(By.ID, "urlbar")
|
urlbar = self.marionette.find_element(By.ID, "urlbar-input")
|
||||||
urlbar.send_keys(self.mod_key + "a")
|
urlbar.send_keys(self.mod_key + "a")
|
||||||
urlbar.send_keys(self.mod_key + "x")
|
urlbar.send_keys(self.mod_key + "x")
|
||||||
urlbar.send_keys(self.test_page_remote + Keys.ENTER)
|
urlbar.send_keys(self.test_page_remote + Keys.ENTER)
|
||||||
@ -431,7 +425,6 @@ class TestBackForwardNavigation(BaseNavigationTestCase):
|
|||||||
]
|
]
|
||||||
self.run_bfcache_test(test_pages)
|
self.run_bfcache_test(test_pages)
|
||||||
|
|
||||||
@skip_if_mobile("Test file is only located on host machine")
|
|
||||||
def test_file_url(self):
|
def test_file_url(self):
|
||||||
test_pages = [
|
test_pages = [
|
||||||
{"url": self.test_page_remote},
|
{"url": self.test_page_remote},
|
||||||
@ -521,7 +514,6 @@ class TestBackForwardNavigation(BaseNavigationTestCase):
|
|||||||
]
|
]
|
||||||
self.run_bfcache_test(test_pages)
|
self.run_bfcache_test(test_pages)
|
||||||
|
|
||||||
@skip_if_mobile("Bug 1333209 - Process killed because of connection loss")
|
|
||||||
def test_non_remote_about_pages(self):
|
def test_non_remote_about_pages(self):
|
||||||
test_pages = [
|
test_pages = [
|
||||||
{"url": "about:preferences", "is_remote": False},
|
{"url": "about:preferences", "is_remote": False},
|
||||||
@ -620,7 +612,6 @@ class TestRefresh(BaseNavigationTestCase):
|
|||||||
self.marionette.refresh()
|
self.marionette.refresh()
|
||||||
self.marionette.find_element(By.NAME, "third")
|
self.marionette.find_element(By.NAME, "third")
|
||||||
|
|
||||||
@skip_if_mobile("Test file is only located on host machine")
|
|
||||||
def test_file_url(self):
|
def test_file_url(self):
|
||||||
self.marionette.navigate(self.test_page_file_url)
|
self.marionette.navigate(self.test_page_file_url)
|
||||||
self.assertEqual(self.test_page_file_url, self.marionette.get_url())
|
self.assertEqual(self.test_page_file_url, self.marionette.get_url())
|
||||||
|
@ -13,7 +13,7 @@ class TestPageSourceChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
super(TestPageSourceChrome, self).setUp()
|
super(TestPageSourceChrome, self).setUp()
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
@ -22,4 +22,4 @@ class TestPageSourceChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
def testShouldReturnXULDetails(self):
|
def testShouldReturnXULDetails(self):
|
||||||
source = self.marionette.page_source
|
source = self.marionette.page_source
|
||||||
self.assertTrue('<textbox id="textInput"' in source)
|
self.assertTrue('<input xmlns="http://www.w3.org/1999/xhtml" id="textInput"' in source)
|
||||||
|
@ -10,8 +10,6 @@ from marionette_driver.errors import JavascriptException
|
|||||||
from marionette_harness import (
|
from marionette_harness import (
|
||||||
MarionetteTestCase,
|
MarionetteTestCase,
|
||||||
run_if_manage_instance,
|
run_if_manage_instance,
|
||||||
skip_if_desktop,
|
|
||||||
skip_if_mobile
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -43,7 +41,6 @@ class TestPreferences(MarionetteTestCase):
|
|||||||
self.assertEqual(self.marionette.get_pref(key), value,
|
self.assertEqual(self.marionette.get_pref(key), value,
|
||||||
"Preference {} hasn't been set to {}".format(key, repr(value)))
|
"Preference {} hasn't been set to {}".format(key, repr(value)))
|
||||||
|
|
||||||
@skip_if_mobile("Only runnable with Firefox")
|
|
||||||
def test_desktop_instance_preferences(self):
|
def test_desktop_instance_preferences(self):
|
||||||
required_prefs = geckoinstance.DesktopInstance.desktop_prefs
|
required_prefs = geckoinstance.DesktopInstance.desktop_prefs
|
||||||
|
|
||||||
@ -54,17 +51,6 @@ class TestPreferences(MarionetteTestCase):
|
|||||||
self.assertEqual(self.marionette.get_pref(key), value,
|
self.assertEqual(self.marionette.get_pref(key), value,
|
||||||
"Preference {} hasn't been set to {}".format(key, value))
|
"Preference {} hasn't been set to {}".format(key, value))
|
||||||
|
|
||||||
@skip_if_desktop("Only runnable with Fennec")
|
|
||||||
def test_fennec_instance_preferences(self):
|
|
||||||
required_prefs = geckoinstance.FennecInstance.required_prefs
|
|
||||||
|
|
||||||
for key, value in required_prefs.iteritems():
|
|
||||||
if key in ["browser.tabs.remote.autostart"]:
|
|
||||||
return
|
|
||||||
|
|
||||||
self.assertEqual(self.marionette.get_pref(key), value,
|
|
||||||
"Preference {} hasn't been set to {}".format(key, value))
|
|
||||||
|
|
||||||
def test_clear_pref(self):
|
def test_clear_pref(self):
|
||||||
self.assertIsNone(self.marionette.get_pref(self.prefs["bool"]))
|
self.assertIsNone(self.marionette.get_pref(self.prefs["bool"]))
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ from marionette_harness import (
|
|||||||
MarionetteTestCase,
|
MarionetteTestCase,
|
||||||
parameterized,
|
parameterized,
|
||||||
skip_if_desktop,
|
skip_if_desktop,
|
||||||
skip_if_mobile,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -22,12 +21,8 @@ class TestScreenOrientation(MarionetteTestCase):
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
MarionetteTestCase.setUp(self)
|
MarionetteTestCase.setUp(self)
|
||||||
self.is_mobile = self.marionette.session_capabilities.get("rotatable", False)
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
if self.is_mobile:
|
|
||||||
self.marionette.set_orientation(default_orientation)
|
|
||||||
self.wait_for_orientation(default_orientation)
|
|
||||||
MarionetteTestCase.tearDown(self)
|
MarionetteTestCase.tearDown(self)
|
||||||
|
|
||||||
def wait_for_orientation(self, orientation, timeout=None):
|
def wait_for_orientation(self, orientation, timeout=None):
|
||||||
@ -75,7 +70,6 @@ class TestScreenOrientation(MarionetteTestCase):
|
|||||||
unknown_orientation.format("null")):
|
unknown_orientation.format("null")):
|
||||||
self.marionette.set_orientation(None)
|
self.marionette.set_orientation(None)
|
||||||
|
|
||||||
@skip_if_mobile("Specific test for Firefox")
|
|
||||||
def test_unsupported_operation_on_desktop(self):
|
def test_unsupported_operation_on_desktop(self):
|
||||||
with self.assertRaises(errors.UnsupportedOperationException):
|
with self.assertRaises(errors.UnsupportedOperationException):
|
||||||
self.marionette.set_orientation("landscape-primary")
|
self.marionette.set_orientation("landscape-primary")
|
||||||
|
@ -8,15 +8,16 @@ import base64
|
|||||||
import hashlib
|
import hashlib
|
||||||
import imghdr
|
import imghdr
|
||||||
import struct
|
import struct
|
||||||
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import unittest
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from marionette_driver import By
|
from marionette_driver import By
|
||||||
from marionette_driver.errors import NoSuchElementException, NoSuchWindowException
|
from marionette_driver.errors import NoSuchWindowException
|
||||||
from marionette_harness import (
|
from marionette_harness import (
|
||||||
MarionetteTestCase,
|
MarionetteTestCase,
|
||||||
skip,
|
skip,
|
||||||
skip_if_mobile,
|
|
||||||
WindowManagerMixin,
|
WindowManagerMixin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
"""))
|
"""))
|
||||||
|
|
||||||
def open_dialog(self):
|
def open_dialog(self):
|
||||||
return self.open_chrome_window("chrome://marionette/content/test_dialog.xul")
|
return self.open_chrome_window("chrome://marionette/content/test_dialog.xhtml")
|
||||||
|
|
||||||
def test_capture_different_context(self):
|
def test_capture_different_context(self):
|
||||||
"""Check that screenshots in content and chrome are different."""
|
"""Check that screenshots in content and chrome are different."""
|
||||||
@ -144,7 +145,6 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
screenshot_chrome = self.marionette.screenshot()
|
screenshot_chrome = self.marionette.screenshot()
|
||||||
self.assertNotEqual(screenshot_content, screenshot_chrome)
|
self.assertNotEqual(screenshot_content, screenshot_chrome)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_capture_element(self):
|
def test_capture_element(self):
|
||||||
dialog = self.open_dialog()
|
dialog = self.open_dialog()
|
||||||
self.marionette.switch_to_window(dialog)
|
self.marionette.switch_to_window(dialog)
|
||||||
@ -162,8 +162,6 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
self.marionette.close_chrome_window()
|
self.marionette.close_chrome_window()
|
||||||
self.marionette.switch_to_window(self.start_window)
|
self.marionette.switch_to_window(self.start_window)
|
||||||
|
|
||||||
# @skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
@skip("Bug 1329424 - AssertionError: u'iVBORw0KGgoA... (images unexpectedly equal)")
|
|
||||||
def test_capture_flags(self):
|
def test_capture_flags(self):
|
||||||
dialog = self.open_dialog()
|
dialog = self.open_dialog()
|
||||||
self.marionette.switch_to_window(dialog)
|
self.marionette.switch_to_window(dialog)
|
||||||
@ -192,7 +190,6 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
self.assertEqual(self.scale(self.get_element_dimensions(self.document_element)),
|
self.assertEqual(self.scale(self.get_element_dimensions(self.document_element)),
|
||||||
self.get_image_dimensions(screenshot_full))
|
self.get_image_dimensions(screenshot_full))
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_capture_window_already_closed(self):
|
def test_capture_window_already_closed(self):
|
||||||
dialog = self.open_dialog()
|
dialog = self.open_dialog()
|
||||||
self.marionette.switch_to_window(dialog)
|
self.marionette.switch_to_window(dialog)
|
||||||
@ -201,7 +198,6 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
self.assertRaises(NoSuchWindowException, self.marionette.screenshot)
|
self.assertRaises(NoSuchWindowException, self.marionette.screenshot)
|
||||||
self.marionette.switch_to_window(self.start_window)
|
self.marionette.switch_to_window(self.start_window)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_formats(self):
|
def test_formats(self):
|
||||||
dialog = self.open_dialog()
|
dialog = self.open_dialog()
|
||||||
self.marionette.switch_to_window(dialog)
|
self.marionette.switch_to_window(dialog)
|
||||||
@ -215,46 +211,6 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
self.marionette.screenshot(format="cheese")
|
self.marionette.screenshot(format="cheese")
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_highlight_elements(self):
|
|
||||||
dialog = self.open_dialog()
|
|
||||||
self.marionette.switch_to_window(dialog)
|
|
||||||
|
|
||||||
# Highlighting the element itself shouldn't make the image larger
|
|
||||||
element = self.marionette.find_element(By.ID, "test-list")
|
|
||||||
screenshot_element = self.marionette.screenshot(element=element)
|
|
||||||
screenshot_highlight = self.marionette.screenshot(element=element,
|
|
||||||
highlights=[element])
|
|
||||||
self.assertEqual(self.scale(self.get_element_dimensions(element)),
|
|
||||||
self.get_image_dimensions(screenshot_element))
|
|
||||||
self.assertNotEqual(screenshot_element, screenshot_highlight)
|
|
||||||
|
|
||||||
# Highlighting a sub element
|
|
||||||
button = self.marionette.find_element(By.ID, "choose-button")
|
|
||||||
screenshot_highlight_button = self.marionette.screenshot(element=element,
|
|
||||||
highlights=[button])
|
|
||||||
self.assertNotEqual(screenshot_element, screenshot_highlight_button)
|
|
||||||
self.assertNotEqual(screenshot_highlight, screenshot_highlight_button)
|
|
||||||
|
|
||||||
self.marionette.close_chrome_window()
|
|
||||||
self.marionette.switch_to_window(self.start_window)
|
|
||||||
|
|
||||||
def test_highlight_element_not_seen(self):
|
|
||||||
"""Check that for not found elements an exception is raised."""
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
self.marionette.navigate(box)
|
|
||||||
content_element = self.marionette.find_element(By.ID, "green")
|
|
||||||
|
|
||||||
self.assertRaisesRegexp(NoSuchElementException, "Web element reference not seen before",
|
|
||||||
self.marionette.screenshot, highlights=[content_element])
|
|
||||||
|
|
||||||
chrome_document_element = self.document_element
|
|
||||||
with self.marionette.using_context('content'):
|
|
||||||
self.assertRaisesRegexp(NoSuchElementException,
|
|
||||||
"Web element reference not seen before",
|
|
||||||
self.marionette.screenshot,
|
|
||||||
highlights=[chrome_document_element])
|
|
||||||
|
|
||||||
|
|
||||||
class TestScreenCaptureContent(WindowManagerMixin, ScreenCaptureTestCase):
|
class TestScreenCaptureContent(WindowManagerMixin, ScreenCaptureTestCase):
|
||||||
|
|
||||||
@ -280,7 +236,6 @@ class TestScreenCaptureContent(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
self.assertRaises(NoSuchWindowException, self.marionette.screenshot)
|
self.assertRaises(NoSuchWindowException, self.marionette.screenshot)
|
||||||
self.marionette.switch_to_window(self.start_tab)
|
self.marionette.switch_to_window(self.start_tab)
|
||||||
|
|
||||||
@skip_if_mobile("Bug 1487124 - Android need its own maximum allowed dimensions")
|
|
||||||
def test_capture_vertical_bounds(self):
|
def test_capture_vertical_bounds(self):
|
||||||
self.marionette.navigate(inline("<body style='margin-top: 32768px'>foo"))
|
self.marionette.navigate(inline("<body style='margin-top: 32768px'>foo"))
|
||||||
screenshot = self.marionette.screenshot()
|
screenshot = self.marionette.screenshot()
|
||||||
@ -304,7 +259,7 @@ class TestScreenCaptureContent(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
self.get_image_dimensions(screenshot))
|
self.get_image_dimensions(screenshot))
|
||||||
self.assertGreater(self.page_y_offset, 0)
|
self.assertGreater(self.page_y_offset, 0)
|
||||||
|
|
||||||
@skip("Bug 1330560 - AssertionError: u'iVBORw0KGgoA... (images unexpectedly equal)")
|
@unittest.skipIf(sys.platform.startswith("win"), "Bug 1330560")
|
||||||
def test_capture_flags(self):
|
def test_capture_flags(self):
|
||||||
self.marionette.navigate(input)
|
self.marionette.navigate(input)
|
||||||
|
|
||||||
@ -361,25 +316,6 @@ class TestScreenCaptureContent(WindowManagerMixin, ScreenCaptureTestCase):
|
|||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
self.marionette.screenshot(format="cheese")
|
self.marionette.screenshot(format="cheese")
|
||||||
|
|
||||||
def test_highlight_elements(self):
|
|
||||||
self.marionette.navigate(box)
|
|
||||||
element = self.marionette.find_element(By.TAG_NAME, "div")
|
|
||||||
|
|
||||||
# Highlighting the element itself shouldn't make the image larger
|
|
||||||
screenshot_element = self.marionette.screenshot(element=element)
|
|
||||||
screenshot_highlight = self.marionette.screenshot(element=element,
|
|
||||||
highlights=[element])
|
|
||||||
self.assertEqual(self.scale(self.get_element_dimensions(element)),
|
|
||||||
self.get_image_dimensions(screenshot_highlight))
|
|
||||||
self.assertNotEqual(screenshot_element, screenshot_highlight)
|
|
||||||
|
|
||||||
# Highlighting a sub element
|
|
||||||
paragraph = self.marionette.find_element(By.ID, "green")
|
|
||||||
screenshot_highlight_paragraph = self.marionette.screenshot(element=element,
|
|
||||||
highlights=[paragraph])
|
|
||||||
self.assertNotEqual(screenshot_element, screenshot_highlight_paragraph)
|
|
||||||
self.assertNotEqual(screenshot_highlight, screenshot_highlight_paragraph)
|
|
||||||
|
|
||||||
def test_save_screenshot(self):
|
def test_save_screenshot(self):
|
||||||
expected = self.marionette.screenshot(format="binary")
|
expected = self.marionette.screenshot(format="binary")
|
||||||
with tempfile.TemporaryFile('w+b') as fh:
|
with tempfile.TemporaryFile('w+b') as fh:
|
||||||
|
@ -15,7 +15,7 @@ class TestSwitchFrameChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
super(TestSwitchFrameChrome, self).setUp()
|
super(TestSwitchFrameChrome, self).setUp()
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
self.assertNotEqual(self.start_window, self.marionette.current_chrome_window_handle)
|
self.assertNotEqual(self.start_window, self.marionette.current_chrome_window_handle)
|
||||||
|
|
||||||
@ -24,26 +24,26 @@ class TestSwitchFrameChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
super(TestSwitchFrameChrome, self).tearDown()
|
super(TestSwitchFrameChrome, self).tearDown()
|
||||||
|
|
||||||
def test_switch_simple(self):
|
def test_switch_simple(self):
|
||||||
self.assertIn("test.xul", self.marionette.get_url(), "Initial navigation has failed")
|
self.assertIn("test.xhtml", self.marionette.get_url(), "Initial navigation has failed")
|
||||||
self.marionette.switch_to_frame(0)
|
self.marionette.switch_to_frame(0)
|
||||||
self.assertIn("test2.xul", self.marionette.get_url(),"Switching by index failed")
|
self.assertIn("test2.xhtml", self.marionette.get_url(),"Switching by index failed")
|
||||||
self.marionette.switch_to_frame()
|
self.marionette.switch_to_frame()
|
||||||
self.assertEqual(None, self.marionette.get_active_frame(), "Switiching by null failed")
|
self.assertEqual(None, self.marionette.get_active_frame(), "Switiching by null failed")
|
||||||
self.assertIn("test.xul", self.marionette.get_url(), "Switching by null failed")
|
self.assertIn("test.xhtml", self.marionette.get_url(), "Switching by null failed")
|
||||||
self.marionette.switch_to_frame("iframe")
|
self.marionette.switch_to_frame("iframe")
|
||||||
self.assertIn("test2.xul", self.marionette.get_url(), "Switching by name failed")
|
self.assertIn("test2.xhtml", self.marionette.get_url(), "Switching by name failed")
|
||||||
self.marionette.switch_to_frame()
|
self.marionette.switch_to_frame()
|
||||||
self.assertIn("test.xul", self.marionette.get_url(), "Switching by null failed")
|
self.assertIn("test.xhtml", self.marionette.get_url(), "Switching by null failed")
|
||||||
self.marionette.switch_to_frame("iframename")
|
self.marionette.switch_to_frame("iframename")
|
||||||
self.assertIn("test2.xul", self.marionette.get_url(), "Switching by name failed")
|
self.assertIn("test2.xhtml", self.marionette.get_url(), "Switching by name failed")
|
||||||
iframe_element = self.marionette.get_active_frame()
|
iframe_element = self.marionette.get_active_frame()
|
||||||
self.marionette.switch_to_frame()
|
self.marionette.switch_to_frame()
|
||||||
self.assertIn("test.xul", self.marionette.get_url(), "Switching by null failed")
|
self.assertIn("test.xhtml", self.marionette.get_url(), "Switching by null failed")
|
||||||
self.marionette.switch_to_frame(iframe_element)
|
self.marionette.switch_to_frame(iframe_element)
|
||||||
self.assertIn("test2.xul", self.marionette.get_url(), "Switching by element failed")
|
self.assertIn("test2.xhtml", self.marionette.get_url(), "Switching by element failed")
|
||||||
|
|
||||||
def test_stack_trace(self):
|
def test_stack_trace(self):
|
||||||
self.assertIn("test.xul", self.marionette.get_url(), "Initial navigation has failed")
|
self.assertIn("test.xhtml", self.marionette.get_url(), "Initial navigation has failed")
|
||||||
self.marionette.switch_to_frame(0)
|
self.marionette.switch_to_frame(0)
|
||||||
self.assertRaises(JavascriptException, self.marionette.execute_async_script, "foo();")
|
self.assertRaises(JavascriptException, self.marionette.execute_async_script, "foo();")
|
||||||
try:
|
try:
|
||||||
|
@ -9,7 +9,6 @@ from marionette_driver.keys import Keys
|
|||||||
|
|
||||||
from marionette_harness import (
|
from marionette_harness import (
|
||||||
MarionetteTestCase,
|
MarionetteTestCase,
|
||||||
skip_if_mobile,
|
|
||||||
WindowManagerMixin,
|
WindowManagerMixin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -89,7 +88,6 @@ class TestSwitchToWindowContent(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
||||||
self.assertEqual(self.get_selected_tab_index(), self.selected_tab_index)
|
self.assertEqual(self.get_selected_tab_index(), self.selected_tab_index)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_switch_tabs_in_different_windows_with_focus_change(self):
|
def test_switch_tabs_in_different_windows_with_focus_change(self):
|
||||||
new_tab1 = self.open_tab(focus=True)
|
new_tab1 = self.open_tab(focus=True)
|
||||||
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
||||||
|
@ -12,7 +12,7 @@ from marionette_driver.errors import (
|
|||||||
)
|
)
|
||||||
from marionette_driver.marionette import HTMLElement
|
from marionette_driver.marionette import HTMLElement
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, run_if_manage_instance, skip_if_mobile
|
from marionette_harness import MarionetteTestCase, run_if_manage_instance
|
||||||
|
|
||||||
|
|
||||||
class TestTimeouts(MarionetteTestCase):
|
class TestTimeouts(MarionetteTestCase):
|
||||||
@ -65,7 +65,6 @@ class TestTimeouts(MarionetteTestCase):
|
|||||||
self.assertRaises(NoSuchElementException, self.marionette.find_element, By.ID, "newDiv")
|
self.assertRaises(NoSuchElementException, self.marionette.find_element, By.ID, "newDiv")
|
||||||
|
|
||||||
@run_if_manage_instance("Only runnable if Marionette manages the instance")
|
@run_if_manage_instance("Only runnable if Marionette manages the instance")
|
||||||
@skip_if_mobile("Bug 1322993 - Missing temporary folder")
|
|
||||||
def test_reset_timeout(self):
|
def test_reset_timeout(self):
|
||||||
timeouts = [getattr(self.marionette.timeout, f) for f in (
|
timeouts = [getattr(self.marionette.timeout, f) for f in (
|
||||||
'implicit', 'page_load', 'script',)]
|
'implicit', 'page_load', 'script',)]
|
||||||
|
@ -20,7 +20,7 @@ class TestTitleChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
super(TestTitleChrome, self).tearDown()
|
super(TestTitleChrome, self).tearDown()
|
||||||
|
|
||||||
def test_get_chrome_title(self):
|
def test_get_chrome_title(self):
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
title = self.marionette.execute_script(
|
title = self.marionette.execute_script(
|
||||||
|
@ -10,7 +10,7 @@ from marionette_driver.by import By
|
|||||||
from marionette_driver.errors import ElementNotInteractableException
|
from marionette_driver.errors import ElementNotInteractableException
|
||||||
from marionette_driver.keys import Keys
|
from marionette_driver.keys import Keys
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, skip, skip_if_mobile
|
from marionette_harness import MarionetteTestCase, skip
|
||||||
|
|
||||||
|
|
||||||
def inline(doc):
|
def inline(doc):
|
||||||
@ -34,7 +34,6 @@ class TestTypingChrome(TypingTestCase):
|
|||||||
super(TestTypingChrome, self).setUp()
|
super(TestTypingChrome, self).setUp()
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome elements not available for Fennec")
|
|
||||||
def test_cut_and_paste_shortcuts(self):
|
def test_cut_and_paste_shortcuts(self):
|
||||||
with self.marionette.using_context("content"):
|
with self.marionette.using_context("content"):
|
||||||
test_html = self.marionette.absolute_url("keyboard.html")
|
test_html = self.marionette.absolute_url("keyboard.html")
|
||||||
@ -50,12 +49,12 @@ class TestTypingChrome(TypingTestCase):
|
|||||||
key_reporter.send_keys(self.mod_key, "x")
|
key_reporter.send_keys(self.mod_key, "x")
|
||||||
self.assertEqual("", key_reporter.get_property("value"))
|
self.assertEqual("", key_reporter.get_property("value"))
|
||||||
|
|
||||||
url_bar = self.marionette.find_element(By.ID, "urlbar")
|
url_bar = self.marionette.find_element(By.ID, "urlbar-input")
|
||||||
|
|
||||||
# Clear contents first
|
# Clear contents first
|
||||||
url_bar.send_keys(self.mod_key, "a")
|
url_bar.send_keys(self.mod_key, "a")
|
||||||
url_bar.send_keys(Keys.BACK_SPACE)
|
url_bar.send_keys(Keys.BACK_SPACE)
|
||||||
self.assertEqual("", url_bar.get_attribute("value"))
|
self.assertEqual("", url_bar.get_property("value"))
|
||||||
|
|
||||||
url_bar.send_keys(self.mod_key, "v")
|
url_bar.send_keys(self.mod_key, "v")
|
||||||
self.assertEqual("zyxwvutsr", url_bar.get_property("value"))
|
self.assertEqual("zyxwvutsr", url_bar.get_property("value"))
|
||||||
@ -215,7 +214,6 @@ class TestTypingContent(TypingTestCase):
|
|||||||
# filled, we're a letter short here
|
# filled, we're a letter short here
|
||||||
self.assertEqual(result.text, "I like chees")
|
self.assertEqual(result.text, "I like chees")
|
||||||
|
|
||||||
@skip_if_mobile("Bug 1333069 - Assertion: 'down: 40' not found in u''")
|
|
||||||
def test_should_report_key_code_of_arrow_keys_up_down_events(self):
|
def test_should_report_key_code_of_arrow_keys_up_down_events(self):
|
||||||
test_html = self.marionette.absolute_url("keyboard.html")
|
test_html = self.marionette.absolute_url("keyboard.html")
|
||||||
self.marionette.navigate(test_html)
|
self.marionette.navigate(test_html)
|
||||||
|
@ -31,7 +31,7 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertNotIn(new_window, self.marionette.window_handles)
|
self.assertNotIn(new_window, self.marionette.window_handles)
|
||||||
|
|
||||||
def test_close_chrome_window_for_non_browser_window(self):
|
def test_close_chrome_window_for_non_browser_window(self):
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
self.assertIn(win, self.marionette.chrome_window_handles)
|
self.assertIn(win, self.marionette.chrome_window_handles)
|
||||||
|
@ -7,7 +7,7 @@ from __future__ import absolute_import
|
|||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from marionette_driver.by import By
|
from marionette_driver.by import By
|
||||||
from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
|
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
||||||
|
|
||||||
|
|
||||||
def inline(doc):
|
def inline(doc):
|
||||||
@ -22,7 +22,6 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
super(TestCloseWindow, self).tearDown()
|
super(TestCloseWindow, self).tearDown()
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome windows not available for Fennec")
|
|
||||||
def test_close_chrome_window_for_browser_window(self):
|
def test_close_chrome_window_for_browser_window(self):
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
new_window = self.open_window()
|
new_window = self.open_window()
|
||||||
@ -34,9 +33,8 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertListEqual(self.start_windows, chrome_window_handles)
|
self.assertListEqual(self.start_windows, chrome_window_handles)
|
||||||
self.assertNotIn(new_window, self.marionette.window_handles)
|
self.assertNotIn(new_window, self.marionette.window_handles)
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome windows not available for Fennec")
|
|
||||||
def test_close_chrome_window_for_non_browser_window(self):
|
def test_close_chrome_window_for_non_browser_window(self):
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
self.assertIn(new_window, self.marionette.chrome_window_handles)
|
self.assertIn(new_window, self.marionette.chrome_window_handles)
|
||||||
@ -46,7 +44,6 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertListEqual(self.start_windows, chrome_window_handles)
|
self.assertListEqual(self.start_windows, chrome_window_handles)
|
||||||
self.assertNotIn(new_window, self.marionette.window_handles)
|
self.assertNotIn(new_window, self.marionette.window_handles)
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome windows not available for Fennec")
|
|
||||||
def test_close_chrome_window_for_last_open_window(self):
|
def test_close_chrome_window_for_last_open_window(self):
|
||||||
self.close_all_windows()
|
self.close_all_windows()
|
||||||
|
|
||||||
@ -79,7 +76,6 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.marionette.find_element(By.TAG_NAME, "input").send_keys("foo")
|
self.marionette.find_element(By.TAG_NAME, "input").send_keys("foo")
|
||||||
self.marionette.close()
|
self.marionette.close()
|
||||||
|
|
||||||
@skip_if_mobile("Interacting with chrome windows not available for Fennec")
|
|
||||||
def test_close_window_for_browser_window_with_single_tab(self):
|
def test_close_window_for_browser_window_with_single_tab(self):
|
||||||
new_tab = self.open_window()
|
new_tab = self.open_window()
|
||||||
self.marionette.switch_to_window(new_tab)
|
self.marionette.switch_to_window(new_tab)
|
||||||
@ -98,7 +94,6 @@ class TestCloseWindow(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertListEqual([self.start_window], self.marionette.chrome_window_handles)
|
self.assertListEqual([self.start_window], self.marionette.chrome_window_handles)
|
||||||
self.assertIsNotNone(self.marionette.session)
|
self.assertIsNotNone(self.marionette.session)
|
||||||
|
|
||||||
@skip_if_mobile("discardBrowser is only available in Firefox")
|
|
||||||
def test_close_browserless_tab(self):
|
def test_close_browserless_tab(self):
|
||||||
self.close_all_tabs()
|
self.close_all_tabs()
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestWindowHandles, self).setUp()
|
super(TestWindowHandles, self).setUp()
|
||||||
|
|
||||||
self.xul_dialog = "chrome://marionette/content/test_dialog.xul"
|
self.chrome_dialog = "chrome://marionette/content/test_dialog.xhtml"
|
||||||
|
|
||||||
self.marionette.set_context("chrome")
|
self.marionette.set_context("chrome")
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertIn(new_browser, self.marionette.chrome_window_handles)
|
self.assertIn(new_browser, self.marionette.chrome_window_handles)
|
||||||
self.assertEqual(self.marionette.current_chrome_window_handle, self.start_window)
|
self.assertEqual(self.marionette.current_chrome_window_handle, self.start_window)
|
||||||
|
|
||||||
new_dialog = self.open_chrome_window(self.xul_dialog)
|
new_dialog = self.open_chrome_window(self.chrome_dialog)
|
||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(len(self.marionette.chrome_window_handles), len(self.start_windows) + 2)
|
self.assertEqual(len(self.marionette.chrome_window_handles), len(self.start_windows) + 2)
|
||||||
self.assertIn(new_dialog, self.marionette.chrome_window_handles)
|
self.assertIn(new_dialog, self.marionette.chrome_window_handles)
|
||||||
@ -62,7 +62,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
window_handles_in_chrome_scope)
|
window_handles_in_chrome_scope)
|
||||||
|
|
||||||
def test_chrome_window_handles_after_opening_new_chrome_window(self):
|
def test_chrome_window_handles_after_opening_new_chrome_window(self):
|
||||||
new_window = self.open_chrome_window(self.xul_dialog)
|
new_window = self.open_chrome_window(self.chrome_dialog)
|
||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(len(self.marionette.chrome_window_handles), len(self.start_windows) + 1)
|
self.assertEqual(len(self.marionette.chrome_window_handles), len(self.start_windows) + 1)
|
||||||
self.assertIn(new_window, self.marionette.chrome_window_handles)
|
self.assertIn(new_window, self.marionette.chrome_window_handles)
|
||||||
@ -72,7 +72,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(self.marionette.current_chrome_window_handle, new_window)
|
self.assertEqual(self.marionette.current_chrome_window_handle, new_window)
|
||||||
self.assertEqual(self.marionette.get_url(), self.xul_dialog)
|
self.assertEqual(self.marionette.get_url(), self.chrome_dialog)
|
||||||
|
|
||||||
# Close the chrome window, and carry on in our original window.
|
# Close the chrome window, and carry on in our original window.
|
||||||
self.marionette.close_chrome_window()
|
self.marionette.close_chrome_window()
|
||||||
@ -158,7 +158,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
||||||
|
|
||||||
def test_window_handles_after_opening_new_chrome_window(self):
|
def test_window_handles_after_opening_new_chrome_window(self):
|
||||||
new_window = self.open_chrome_window(self.xul_dialog)
|
new_window = self.open_chrome_window(self.chrome_dialog)
|
||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(len(self.marionette.window_handles), len(self.start_tabs))
|
self.assertEqual(len(self.marionette.window_handles), len(self.start_tabs))
|
||||||
self.assertNotIn(new_window, self.marionette.window_handles)
|
self.assertNotIn(new_window, self.marionette.window_handles)
|
||||||
@ -166,7 +166,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
|
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(self.marionette.get_url(), self.xul_dialog)
|
self.assertEqual(self.marionette.get_url(), self.chrome_dialog)
|
||||||
|
|
||||||
# Check that the opened dialog is not accessible via window handles
|
# Check that the opened dialog is not accessible via window handles
|
||||||
with self.assertRaises(errors.NoSuchWindowException):
|
with self.assertRaises(errors.NoSuchWindowException):
|
||||||
|
@ -9,7 +9,7 @@ import urllib
|
|||||||
|
|
||||||
from marionette_driver import errors
|
from marionette_driver import errors
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin
|
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
||||||
|
|
||||||
|
|
||||||
def inline(doc):
|
def inline(doc):
|
||||||
@ -21,7 +21,7 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestWindowHandles, self).setUp()
|
super(TestWindowHandles, self).setUp()
|
||||||
|
|
||||||
self.xul_dialog = "chrome://marionette/content/test_dialog.xul"
|
self.chrome_dialog = "chrome://marionette/content/test_dialog.xhtml"
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.close_all_tabs()
|
self.close_all_tabs()
|
||||||
@ -78,9 +78,8 @@ class TestWindowHandles(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def tst_window_handles_after_opening_new_non_browser_window(self):
|
def tst_window_handles_after_opening_new_non_browser_window(self):
|
||||||
new_window = self.open_chrome_window(self.xul_dialog)
|
new_window = self.open_chrome_window(self.chrome_dialog)
|
||||||
self.assert_window_handles()
|
self.assert_window_handles()
|
||||||
self.assertEqual(len(self.marionette.window_handles), len(self.start_tabs))
|
self.assertEqual(len(self.marionette.window_handles), len(self.start_tabs))
|
||||||
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
self.assertEqual(self.marionette.current_window_handle, self.start_tab)
|
||||||
|
@ -7,7 +7,7 @@ from __future__ import absolute_import
|
|||||||
from marionette_driver import By
|
from marionette_driver import By
|
||||||
from marionette_driver.errors import NoSuchWindowException
|
from marionette_driver.errors import NoSuchWindowException
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, WindowManagerMixin, skip_if_mobile
|
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
||||||
|
|
||||||
|
|
||||||
class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
||||||
@ -19,7 +19,6 @@ class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.close_all_tabs()
|
self.close_all_tabs()
|
||||||
super(TestNoSuchWindowContent, self).tearDown()
|
super(TestNoSuchWindowContent, self).tearDown()
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_closed_chrome_window(self):
|
def test_closed_chrome_window(self):
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
new_window = self.open_window()
|
new_window = self.open_window()
|
||||||
@ -39,9 +38,8 @@ class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
|||||||
with self.assertRaises(NoSuchWindowException):
|
with self.assertRaises(NoSuchWindowException):
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_closed_chrome_window_while_in_frame(self):
|
def test_closed_chrome_window_while_in_frame(self):
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
self.marionette.switch_to_frame("iframe")
|
self.marionette.switch_to_frame("iframe")
|
||||||
|
@ -7,7 +7,7 @@ from __future__ import absolute_import
|
|||||||
from marionette_driver import By
|
from marionette_driver import By
|
||||||
from marionette_driver.errors import NoSuchWindowException
|
from marionette_driver.errors import NoSuchWindowException
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase, WindowManagerMixin, skip_if_mobile
|
from marionette_harness import MarionetteTestCase, WindowManagerMixin
|
||||||
|
|
||||||
|
|
||||||
class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
||||||
@ -19,7 +19,6 @@ class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
|||||||
self.close_all_windows()
|
self.close_all_windows()
|
||||||
super(TestNoSuchWindowContent, self).tearDown()
|
super(TestNoSuchWindowContent, self).tearDown()
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_closed_chrome_window(self):
|
def test_closed_chrome_window(self):
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
new_window = self.open_window()
|
new_window = self.open_window()
|
||||||
@ -39,9 +38,8 @@ class TestNoSuchWindowContent(WindowManagerMixin, MarionetteTestCase):
|
|||||||
with self.assertRaises(NoSuchWindowException):
|
with self.assertRaises(NoSuchWindowException):
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
@skip_if_mobile("Fennec doesn't support other chrome windows")
|
|
||||||
def test_closed_chrome_window_while_in_frame(self):
|
def test_closed_chrome_window_while_in_frame(self):
|
||||||
new_window = self.open_chrome_window("chrome://marionette/content/test.xul")
|
new_window = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(new_window)
|
self.marionette.switch_to_window(new_window)
|
||||||
|
|
||||||
with self.marionette.using_context("chrome"):
|
with self.marionette.using_context("chrome"):
|
||||||
|
@ -20,7 +20,7 @@ class TestWindowTypeChrome(WindowManagerMixin, MarionetteTestCase):
|
|||||||
super(TestWindowTypeChrome, self).tearDown()
|
super(TestWindowTypeChrome, self).tearDown()
|
||||||
|
|
||||||
def test_get_window_type(self):
|
def test_get_window_type(self):
|
||||||
win = self.open_chrome_window("chrome://marionette/content/test.xul")
|
win = self.open_chrome_window("chrome://marionette/content/test.xhtml")
|
||||||
self.marionette.switch_to_window(win)
|
self.marionette.switch_to_window(win)
|
||||||
|
|
||||||
window_type = self.marionette.execute_script(
|
window_type = self.marionette.execute_script(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[test_marionette.py]
|
[test_marionette.py]
|
||||||
[test_transport.py]
|
[test_transport.py]
|
||||||
[test_cli_arguments.py]
|
[test_cli_arguments.py]
|
||||||
skip-if = manage_instance == false || appname == 'fennec' # Bug 1298921
|
skip-if = manage_instance == false
|
||||||
[test_geckoinstance.py]
|
[test_geckoinstance.py]
|
||||||
[test_data_driven.py]
|
[test_data_driven.py]
|
||||||
[test_session.py]
|
[test_session.py]
|
||||||
@ -12,20 +12,15 @@ skip-if = manage_instance == false || appname == 'fennec' # Bug 1298921
|
|||||||
expected = fail
|
expected = fail
|
||||||
[test_click.py]
|
[test_click.py]
|
||||||
[test_click_chrome.py]
|
[test_click_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_checkbox.py]
|
[test_checkbox.py]
|
||||||
[test_checkbox_chrome.py]
|
[test_checkbox_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_elementsize.py]
|
[test_elementsize.py]
|
||||||
[test_elementsize_chrome.py]
|
[test_elementsize_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_position.py]
|
[test_position.py]
|
||||||
[test_rendered_element.py]
|
[test_rendered_element.py]
|
||||||
[test_chrome_element_css.py]
|
[test_chrome_element_css.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_element_state.py]
|
[test_element_state.py]
|
||||||
[test_element_state_chrome.py]
|
[test_element_state_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_text.py]
|
[test_text.py]
|
||||||
|
|
||||||
[test_typing.py]
|
[test_typing.py]
|
||||||
@ -34,36 +29,26 @@ skip-if = appname == 'fennec'
|
|||||||
[test_execute_script.py]
|
[test_execute_script.py]
|
||||||
[test_element_retrieval.py]
|
[test_element_retrieval.py]
|
||||||
[test_findelement_chrome.py]
|
[test_findelement_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
|
|
||||||
[test_get_current_url_chrome.py]
|
[test_get_current_url_chrome.py]
|
||||||
[test_navigation.py]
|
[test_navigation.py]
|
||||||
[test_timeouts.py]
|
[test_timeouts.py]
|
||||||
|
|
||||||
[test_anonymous_content.py]
|
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_switch_frame.py]
|
[test_switch_frame.py]
|
||||||
[test_switch_frame_chrome.py]
|
[test_switch_frame_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_switch_window_chrome.py]
|
[test_switch_window_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_switch_window_content.py]
|
[test_switch_window_content.py]
|
||||||
|
|
||||||
[test_pagesource.py]
|
[test_pagesource.py]
|
||||||
[test_pagesource_chrome.py]
|
[test_pagesource_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
|
|
||||||
[test_visibility.py]
|
[test_visibility.py]
|
||||||
[test_window_handles_chrome.py]
|
[test_window_handles_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_window_handles_content.py]
|
[test_window_handles_content.py]
|
||||||
[test_window_close_chrome.py]
|
[test_window_close_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_window_close_content.py]
|
[test_window_close_content.py]
|
||||||
[test_window_rect.py]
|
[test_window_rect.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_window_maximize.py]
|
[test_window_maximize.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_window_status_content.py]
|
[test_window_status_content.py]
|
||||||
[test_window_status_chrome.py]
|
[test_window_status_chrome.py]
|
||||||
|
|
||||||
@ -71,9 +56,7 @@ skip-if = appname == 'fennec'
|
|||||||
[test_cookies.py]
|
[test_cookies.py]
|
||||||
[test_title.py]
|
[test_title.py]
|
||||||
[test_title_chrome.py]
|
[test_title_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_window_type_chrome.py]
|
[test_window_type_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
[test_implicit_waits.py]
|
[test_implicit_waits.py]
|
||||||
[test_wait.py]
|
[test_wait.py]
|
||||||
[test_expected.py]
|
[test_expected.py]
|
||||||
@ -84,40 +67,35 @@ skip-if = appname == 'fennec'
|
|||||||
[test_execute_isolate.py]
|
[test_execute_isolate.py]
|
||||||
[test_click_scrolling.py]
|
[test_click_scrolling.py]
|
||||||
[test_profile_management.py]
|
[test_profile_management.py]
|
||||||
skip-if = manage_instance == false || appname == 'fennec' || (debug && ((os == 'mac') || (os == 'linux'))) # Bug 1298921, Bug 1450355
|
skip-if = manage_instance == false || (debug && ((os == 'mac') || (os == 'linux'))) # Bug 1450355
|
||||||
[test_quit_restart.py]
|
[test_quit_restart.py]
|
||||||
skip-if = manage_instance == false || appname == 'fennec' # Bug 1298921
|
skip-if = manage_instance == false
|
||||||
[test_context.py]
|
[test_context.py]
|
||||||
|
|
||||||
[test_modal_dialogs.py]
|
[test_modal_dialogs.py]
|
||||||
skip-if = appname == 'fennec' # Bug 1325738
|
|
||||||
[test_unhandled_prompt_behavior.py]
|
[test_unhandled_prompt_behavior.py]
|
||||||
skip-if = appname == 'fennec' # Bug 1325738
|
|
||||||
|
|
||||||
[test_key_actions.py]
|
[test_key_actions.py]
|
||||||
[test_mouse_action.py]
|
[test_mouse_action.py]
|
||||||
|
|
||||||
[test_teardown_context_preserved.py]
|
[test_teardown_context_preserved.py]
|
||||||
[test_file_upload.py]
|
[test_file_upload.py]
|
||||||
skip-if = appname == 'fennec' || os == "win" # http://bugs.python.org/issue14574
|
skip-if = os == "win" # http://bugs.python.org/issue14574
|
||||||
|
|
||||||
[test_execute_sandboxes.py]
|
[test_execute_sandboxes.py]
|
||||||
[test_prefs.py]
|
[test_prefs.py]
|
||||||
[test_prefs_enforce.py]
|
[test_prefs_enforce.py]
|
||||||
skip-if = manage_instance == false || appname == 'fennec' # Bug 1298921
|
skip-if = manage_instance == false
|
||||||
|
|
||||||
[test_shadow_dom.py]
|
[test_shadow_dom.py]
|
||||||
|
|
||||||
[test_chrome.py]
|
[test_chrome.py]
|
||||||
skip-if = appname == 'fennec'
|
|
||||||
|
|
||||||
[test_addons.py]
|
[test_addons.py]
|
||||||
skip-if = appname == 'fennec' # Bug 1330598
|
|
||||||
|
|
||||||
[test_select.py]
|
[test_select.py]
|
||||||
[test_crash.py]
|
[test_crash.py]
|
||||||
skip-if = asan || manage_instance == false || appname == 'fennec' # Bug 1298921
|
skip-if = asan || manage_instance == false
|
||||||
[test_localization.py]
|
[test_localization.py]
|
||||||
|
|
||||||
[test_reftest.py]
|
[test_reftest.py]
|
||||||
skip-if = appname == 'fennec' # Bug 1519552
|
|
||||||
|
@ -63,7 +63,6 @@ const DISABLED_ATTRIBUTE_SUPPORTED_XUL = new Set([
|
|||||||
"SCALE",
|
"SCALE",
|
||||||
"TAB",
|
"TAB",
|
||||||
"TABS",
|
"TABS",
|
||||||
"TEXTBOX",
|
|
||||||
"TOOLBARBUTTON",
|
"TOOLBARBUTTON",
|
||||||
"TREE",
|
"TREE",
|
||||||
]);
|
]);
|
||||||
|
@ -33,19 +33,18 @@ marionette.jar:
|
|||||||
content/prefs.js (prefs.js)
|
content/prefs.js (prefs.js)
|
||||||
content/proxy.js (proxy.js)
|
content/proxy.js (proxy.js)
|
||||||
content/reftest.js (reftest.js)
|
content/reftest.js (reftest.js)
|
||||||
content/reftest.xul (reftest.xul)
|
content/reftest.xhtml (reftest.xhtml)
|
||||||
content/server.js (server.js)
|
content/server.js (server.js)
|
||||||
content/stream-utils.js (stream-utils.js)
|
content/stream-utils.js (stream-utils.js)
|
||||||
content/sync.js (sync.js)
|
content/sync.js (sync.js)
|
||||||
content/transport.js (transport.js)
|
content/transport.js (transport.js)
|
||||||
#ifdef ENABLE_TESTS
|
#ifdef ENABLE_TESTS
|
||||||
content/test2.xul (chrome/test2.xul)
|
content/test.xhtml (chrome/test.xhtml)
|
||||||
content/test_anonymous_content.xul (chrome/test_anonymous_content.xul)
|
content/test2.xhtml (chrome/test2.xhtml)
|
||||||
content/test_dialog.dtd (chrome/test_dialog.dtd)
|
content/test_dialog.dtd (chrome/test_dialog.dtd)
|
||||||
content/test_dialog.properties (chrome/test_dialog.properties)
|
content/test_dialog.properties (chrome/test_dialog.properties)
|
||||||
content/test_dialog.xul (chrome/test_dialog.xul)
|
content/test_dialog.xhtml (chrome/test_dialog.xhtml)
|
||||||
content/test_nested_iframe.xul (chrome/test_nested_iframe.xul)
|
content/test_nested_iframe.xhtml (chrome/test_nested_iframe.xhtml)
|
||||||
content/test.xul (chrome/test.xul)
|
|
||||||
#ifdef MOZ_CODE_COVERAGE
|
#ifdef MOZ_CODE_COVERAGE
|
||||||
content/PerTestCoverageUtils.jsm (../../tools/code-coverage/PerTestCoverageUtils.jsm)
|
content/PerTestCoverageUtils.jsm (../../tools/code-coverage/PerTestCoverageUtils.jsm)
|
||||||
#endif
|
#endif
|
||||||
|
@ -1632,18 +1632,13 @@ function switchToFrame(msg) {
|
|||||||
* Accepted values for |opts|:
|
* Accepted values for |opts|:
|
||||||
*
|
*
|
||||||
* @param {UUID=} id
|
* @param {UUID=} id
|
||||||
* Optional web element reference of an element to take a screenshot
|
* Optional web element reference of an element to take a screenshot of.
|
||||||
* of.
|
|
||||||
* @param {boolean=} full
|
* @param {boolean=} full
|
||||||
* True to take a screenshot of the entire document element. Is not
|
* True to take a screenshot of the entire document element. Is only
|
||||||
* considered if {@code id} is not defined. Defaults to true.
|
* considered if <var>id</var> is not defined. Defaults to true.
|
||||||
* @param {Array.<UUID>=} highlights
|
|
||||||
* Draw a border around the elements found by their web element
|
|
||||||
* references.
|
|
||||||
* @param {boolean=} scroll
|
* @param {boolean=} scroll
|
||||||
* When |id| is given, scroll it into view before taking the
|
* When <var>id</var> is given, scroll it into view before taking the
|
||||||
* screenshot. Defaults to true.
|
* screenshot. Defaults to true.
|
||||||
*
|
|
||||||
* @param {capture.Format} format
|
* @param {capture.Format} format
|
||||||
* Format to return the screenshot in.
|
* Format to return the screenshot in.
|
||||||
* @param {Object.<string, ?>} opts
|
* @param {Object.<string, ?>} opts
|
||||||
@ -1652,25 +1647,13 @@ function switchToFrame(msg) {
|
|||||||
* @return {string}
|
* @return {string}
|
||||||
* Base64 encoded string or a SHA-256 hash of the screenshot.
|
* Base64 encoded string or a SHA-256 hash of the screenshot.
|
||||||
*/
|
*/
|
||||||
function takeScreenshot(format, opts = {}) {
|
function takeScreenshot(format, { id, full = true, scroll = true } = {}) {
|
||||||
let id = opts.id;
|
|
||||||
let full = !!opts.full;
|
|
||||||
let highlights = opts.highlights || [];
|
|
||||||
let scroll = !!opts.scroll;
|
|
||||||
|
|
||||||
let win = curContainer.frame;
|
let win = curContainer.frame;
|
||||||
|
|
||||||
let canvas;
|
let canvas;
|
||||||
let highlightEls = highlights
|
|
||||||
.map(ref => WebElement.fromUUID(ref, "content"))
|
|
||||||
.map(webEl => seenEls.get(webEl, win));
|
|
||||||
|
|
||||||
// viewport
|
|
||||||
if (!id && !full) {
|
|
||||||
canvas = capture.viewport(win, highlightEls);
|
|
||||||
|
|
||||||
// element or full document element
|
// element or full document element
|
||||||
} else {
|
if (id || full) {
|
||||||
let el;
|
let el;
|
||||||
if (id) {
|
if (id) {
|
||||||
let webEl = WebElement.fromUUID(id, "content");
|
let webEl = WebElement.fromUUID(id, "content");
|
||||||
@ -1682,7 +1665,11 @@ function takeScreenshot(format, opts = {}) {
|
|||||||
el = win.document.documentElement;
|
el = win.document.documentElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas = capture.element(el, highlightEls);
|
canvas = capture.element(el);
|
||||||
|
|
||||||
|
// viewport
|
||||||
|
} else {
|
||||||
|
canvas = capture.viewport(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
@ -8,7 +8,7 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||||||
|
|
||||||
this.EXPORTED_SYMBOLS = ["modal"];
|
this.EXPORTED_SYMBOLS = ["modal"];
|
||||||
|
|
||||||
const COMMON_DIALOG = "chrome://global/content/commonDialog.xul";
|
const COMMON_DIALOG = "chrome://global/content/commonDialog.xhtml";
|
||||||
|
|
||||||
const isFirefox = () =>
|
const isFirefox = () =>
|
||||||
Services.appinfo.ID == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
Services.appinfo.ID == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
|
||||||
|
@ -14,9 +14,3 @@ Tab
|
|||||||
|
|
||||||
.. autoclass:: Tab
|
.. autoclass:: Tab
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
MenuPanel
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. autoclass:: MenuPanel
|
|
||||||
:members:
|
|
||||||
|
@ -65,8 +65,7 @@ class AddOnInstallBlockedNotification(BaseNotification):
|
|||||||
:returns: The allow button.
|
:returns: The allow button.
|
||||||
"""
|
"""
|
||||||
return self.element.find_element(
|
return self.element.find_element(
|
||||||
By.ANON_ATTRIBUTE, {'anonid': 'button'}).find_element(
|
By.CLASS, "popup-notification-primary-button")
|
||||||
By.ANON_ATTRIBUTE, {'anonid': 'button'})
|
|
||||||
|
|
||||||
|
|
||||||
class AddOnInstallConfirmationNotification(BaseNotification):
|
class AddOnInstallConfirmationNotification(BaseNotification):
|
||||||
|
@ -8,12 +8,10 @@ from marionette_driver import (
|
|||||||
By, Wait
|
By, Wait
|
||||||
)
|
)
|
||||||
|
|
||||||
from marionette_driver.errors import NoSuchElementException
|
|
||||||
|
|
||||||
import firefox_puppeteer.errors as errors
|
import firefox_puppeteer.errors as errors
|
||||||
|
|
||||||
from firefox_puppeteer.api.security import Security
|
from firefox_puppeteer.api.security import Security
|
||||||
from firefox_puppeteer.ui.base import UIBaseLib, DOMElement
|
from firefox_puppeteer.ui.base import UIBaseLib
|
||||||
|
|
||||||
|
|
||||||
class TabBar(UIBaseLib):
|
class TabBar(UIBaseLib):
|
||||||
@ -21,22 +19,13 @@ class TabBar(UIBaseLib):
|
|||||||
|
|
||||||
# Properties for visual elements of the tabs toolbar #
|
# Properties for visual elements of the tabs toolbar #
|
||||||
|
|
||||||
@property
|
|
||||||
def menupanel(self):
|
|
||||||
"""A :class:`MenuPanel` instance which represents the menu panel
|
|
||||||
at the far right side of the tabs toolbar.
|
|
||||||
|
|
||||||
:returns: :class:`MenuPanel` instance.
|
|
||||||
"""
|
|
||||||
return MenuPanel(self.marionette, self.window)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def newtab_button(self):
|
def newtab_button(self):
|
||||||
"""The DOM element which represents the new tab button.
|
"""The DOM element which represents the new tab button.
|
||||||
|
|
||||||
:returns: Reference to the new tab button.
|
:returns: Reference to the new tab button.
|
||||||
"""
|
"""
|
||||||
return self.toolbar.find_element(By.ANON_ATTRIBUTE, {'anonid': 'tabs-newtab-button'})
|
return self.toolbar.find_element(By.ID, 'tabs-newtab-button')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tabs(self):
|
def tabs(self):
|
||||||
@ -233,7 +222,7 @@ class Tab(UIBaseLib):
|
|||||||
|
|
||||||
:returns: Reference to the tab close button.
|
:returns: Reference to the tab close button.
|
||||||
"""
|
"""
|
||||||
return self.tab_element.find_element(By.ANON_ATTRIBUTE, {'anonid': 'close-button'})
|
return self.tab_element.find_element(By.CSS_SELECTOR, '.tab-close-button')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tab_element(self):
|
def tab_element(self):
|
||||||
@ -362,47 +351,3 @@ class Tab(UIBaseLib):
|
|||||||
Use the :func:`~Tab.select` method instead.
|
Use the :func:`~Tab.select` method instead.
|
||||||
"""
|
"""
|
||||||
self.marionette.switch_to_window(self.handle)
|
self.marionette.switch_to_window(self.handle)
|
||||||
|
|
||||||
|
|
||||||
class MenuPanel(UIBaseLib):
|
|
||||||
|
|
||||||
@property
|
|
||||||
def popup(self):
|
|
||||||
"""
|
|
||||||
:returns: The :class:`MenuPanelElement`.
|
|
||||||
"""
|
|
||||||
popup = self.marionette.find_element(By.ID, 'PanelUI-popup')
|
|
||||||
return self.MenuPanelElement(popup)
|
|
||||||
|
|
||||||
class MenuPanelElement(DOMElement):
|
|
||||||
"""Wraps the menu panel."""
|
|
||||||
_buttons = None
|
|
||||||
|
|
||||||
@property
|
|
||||||
def buttons(self):
|
|
||||||
"""
|
|
||||||
:returns: A list of all the clickable buttons in the menu panel.
|
|
||||||
"""
|
|
||||||
if not self._buttons:
|
|
||||||
self._buttons = (self.find_element(By.ID, 'PanelUI-multiView')
|
|
||||||
.find_element(By.ANON_ATTRIBUTE,
|
|
||||||
{'anonid': 'viewContainer'})
|
|
||||||
.find_elements(By.TAG_NAME,
|
|
||||||
'toolbarbutton'))
|
|
||||||
return self._buttons
|
|
||||||
|
|
||||||
def click(self, target=None):
|
|
||||||
"""
|
|
||||||
Overrides HTMLElement.click to provide a target to click.
|
|
||||||
|
|
||||||
:param target: The label associated with the button to click on,
|
|
||||||
e.g., `New Private Window`.
|
|
||||||
"""
|
|
||||||
if not target:
|
|
||||||
return DOMElement.click(self)
|
|
||||||
|
|
||||||
for button in self.buttons:
|
|
||||||
if button.get_attribute('label') == target:
|
|
||||||
return button.click()
|
|
||||||
raise NoSuchElementException('Could not find "{}"" in the '
|
|
||||||
'menu panel UI'.format(target))
|
|
||||||
|
@ -79,7 +79,6 @@ class LocationBar(UIBaseLib):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(LocationBar, self).__init__(*args, **kwargs)
|
super(LocationBar, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
self._autocomplete_results = None
|
|
||||||
self._identity_popup = None
|
self._identity_popup = None
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
@ -90,29 +89,6 @@ class LocationBar(UIBaseLib):
|
|||||||
lambda _: self.value == '',
|
lambda _: self.value == '',
|
||||||
message='Contents of location bar could not be cleared.')
|
message='Contents of location bar could not be cleared.')
|
||||||
|
|
||||||
def close_context_menu(self):
|
|
||||||
"""Closes the Location Bar context menu by a key event."""
|
|
||||||
# TODO: This method should be implemented via the menu API.
|
|
||||||
self.contextmenu.send_keys(keys.Keys.ESCAPE)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def connection_icon(self):
|
|
||||||
""" Provides access to the urlbar connection icon.
|
|
||||||
|
|
||||||
:returns: Reference to the connection icon element.
|
|
||||||
"""
|
|
||||||
return self.marionette.find_element(By.ID, 'connection-icon')
|
|
||||||
|
|
||||||
@property
|
|
||||||
def contextmenu(self):
|
|
||||||
"""Provides access to the urlbar context menu.
|
|
||||||
|
|
||||||
:returns: Reference to the urlbar context menu.
|
|
||||||
"""
|
|
||||||
# TODO: This method should be implemented via the menu API.
|
|
||||||
parent = self.urlbar.find_element(By.ANON_ATTRIBUTE, {'anonid': 'moz-input-box'})
|
|
||||||
return parent.find_element(By.ANON_ATTRIBUTE, {'anonid': 'input-box-contextmenu'})
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def focused(self):
|
def focused(self):
|
||||||
"""Checks the focus state of the location bar.
|
"""Checks the focus state of the location bar.
|
||||||
@ -147,27 +123,6 @@ class LocationBar(UIBaseLib):
|
|||||||
lambda _: self.focused,
|
lambda _: self.focused,
|
||||||
message='Location bar has not be focused.')
|
message='Location bar has not be focused.')
|
||||||
|
|
||||||
def get_contextmenu_entry(self, action):
|
|
||||||
"""Retrieves the urlbar context menu entry corresponding
|
|
||||||
to the given action.
|
|
||||||
|
|
||||||
:param action: The action corresponding to the retrieved value.
|
|
||||||
:returns: Reference to the urlbar contextmenu entry.
|
|
||||||
"""
|
|
||||||
# TODO: This method should be implemented via the menu API.
|
|
||||||
entries = self.contextmenu.find_elements(By.CSS_SELECTOR, 'menuitem')
|
|
||||||
filter_on = 'cmd_%s' % action
|
|
||||||
found = [e for e in entries if e.get_attribute('cmd') == filter_on]
|
|
||||||
return found[0] if len(found) else None
|
|
||||||
|
|
||||||
@property
|
|
||||||
def history_drop_marker(self):
|
|
||||||
"""Provides access to the history drop marker.
|
|
||||||
|
|
||||||
:returns: Reference to the history drop marker.
|
|
||||||
"""
|
|
||||||
return self.urlbar.find_element(By.ANON_ATTRIBUTE, {'anonid': 'historydropmarker'})
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def identity_box(self):
|
def identity_box(self):
|
||||||
"""The DOM element which represents the identity box.
|
"""The DOM element which represents the identity box.
|
||||||
@ -279,7 +234,7 @@ class LocationBar(UIBaseLib):
|
|||||||
|
|
||||||
:returns: Reference to the urlbar input.
|
:returns: Reference to the urlbar input.
|
||||||
"""
|
"""
|
||||||
return self.urlbar.find_element(By.ANON_ATTRIBUTE, {'anonid': 'input'})
|
return self.marionette.find_element(By.ID, 'urlbar-input')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def value(self):
|
def value(self):
|
||||||
@ -287,113 +242,7 @@ class LocationBar(UIBaseLib):
|
|||||||
|
|
||||||
:returns: The urlbar value.
|
:returns: The urlbar value.
|
||||||
"""
|
"""
|
||||||
return self.urlbar.get_property('value')
|
return self.urlbar_input.get_property('value')
|
||||||
|
|
||||||
|
|
||||||
class AutocompleteResults(UIBaseLib):
|
|
||||||
"""Wraps DOM elements and methods for interacting with autocomplete results."""
|
|
||||||
|
|
||||||
def close(self, force=False):
|
|
||||||
"""Closes the urlbar autocomplete popup.
|
|
||||||
|
|
||||||
:param force: If true, the popup is closed by its own hide function,
|
|
||||||
otherwise a key event is sent to close the popup.
|
|
||||||
"""
|
|
||||||
if not self.is_open:
|
|
||||||
return
|
|
||||||
|
|
||||||
if force:
|
|
||||||
self.marionette.execute_script("""
|
|
||||||
arguments[0].hidePopup();
|
|
||||||
""", script_args=[self.element])
|
|
||||||
else:
|
|
||||||
self.element.send_keys(keys.Keys.ESCAPE)
|
|
||||||
|
|
||||||
Wait(self.marionette).until(
|
|
||||||
lambda _: not self.is_open,
|
|
||||||
message='Autocomplete popup has not been closed.')
|
|
||||||
|
|
||||||
def get_matching_text(self, result, match_type):
|
|
||||||
"""Returns an array of strings of the matching text within an autocomplete
|
|
||||||
result in the urlbar.
|
|
||||||
|
|
||||||
:param result: The result to inspect for matches.
|
|
||||||
:param match_type: The type of match to search for (one of `title` or `url`).
|
|
||||||
"""
|
|
||||||
|
|
||||||
if match_type not in ('title', 'url'):
|
|
||||||
raise ValueError('match_type provided must be one of'
|
|
||||||
'"title" or "url", not %s' % match_type)
|
|
||||||
|
|
||||||
# Search for nodes of the given type with emphasized text
|
|
||||||
emphasized_nodes = result.find_elements(
|
|
||||||
By.ANON_ATTRIBUTE,
|
|
||||||
{'class': 'ac-emphasize-text ac-emphasize-text-%s' % match_type}
|
|
||||||
)
|
|
||||||
|
|
||||||
return [node.get_property('textContent') for node in emphasized_nodes]
|
|
||||||
|
|
||||||
@property
|
|
||||||
def visible_results(self):
|
|
||||||
"""Supplies the list of visible autocomplete result nodes.
|
|
||||||
|
|
||||||
:returns: The list of visible results.
|
|
||||||
"""
|
|
||||||
match_count = self.element.get_property('matchCount')
|
|
||||||
|
|
||||||
return self.marionette.execute_script("""
|
|
||||||
let rv = [];
|
|
||||||
let node = arguments[0];
|
|
||||||
let count = arguments[1];
|
|
||||||
|
|
||||||
for (let i = 0; i < count; ++i) {
|
|
||||||
rv.push(node.getItemAtIndex(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
|
||||||
""", script_args=[self.results, match_count])
|
|
||||||
|
|
||||||
@property
|
|
||||||
def is_open(self):
|
|
||||||
"""Returns whether this popup is currently open.
|
|
||||||
|
|
||||||
:returns: True when the popup is open, otherwise false.
|
|
||||||
"""
|
|
||||||
return self.element.get_property('state') == 'open'
|
|
||||||
|
|
||||||
@property
|
|
||||||
def is_complete(self):
|
|
||||||
"""Returns when this popup is open and autocomplete results are complete.
|
|
||||||
|
|
||||||
:returns: True, when autocomplete results have been populated.
|
|
||||||
"""
|
|
||||||
return self.marionette.execute_script("""
|
|
||||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
||||||
|
|
||||||
let win = Services.focus.activeWindow;
|
|
||||||
if (win) {
|
|
||||||
return win.gURLBar.controller.searchStatus >=
|
|
||||||
Components.interfaces.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
""")
|
|
||||||
|
|
||||||
@property
|
|
||||||
def results(self):
|
|
||||||
"""
|
|
||||||
:returns: The autocomplete result container node.
|
|
||||||
"""
|
|
||||||
return self.element.find_element(By.ANON_ATTRIBUTE,
|
|
||||||
{'anonid': 'richlistbox'})
|
|
||||||
|
|
||||||
@property
|
|
||||||
def selected_index(self):
|
|
||||||
"""Provides the index of the selected item in the autocomplete list.
|
|
||||||
|
|
||||||
:returns: The index.
|
|
||||||
"""
|
|
||||||
return self.results.get_property('selectedIndex')
|
|
||||||
|
|
||||||
|
|
||||||
class IdentityPopup(UIBaseLib):
|
class IdentityPopup(UIBaseLib):
|
||||||
|
@ -35,7 +35,6 @@ class BrowserWindow(BaseWindow):
|
|||||||
properties = [
|
properties = [
|
||||||
'chrome://branding/locale/brand.properties',
|
'chrome://branding/locale/brand.properties',
|
||||||
'chrome://browser/locale/browser.properties',
|
'chrome://browser/locale/browser.properties',
|
||||||
'chrome://browser/locale/preferences/preferences.properties',
|
|
||||||
'chrome://global/locale/browser.properties',
|
'chrome://global/locale/browser.properties',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class Wizard(UIBaseLib):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def _buttons(self):
|
def _buttons(self):
|
||||||
return self.element.find_element(By.ANON_ATTRIBUTE, {'anonid': 'Buttons'})
|
return self.element.get_property('_wizardButtons')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cancel_button(self):
|
def cancel_button(self):
|
||||||
|
@ -137,7 +137,7 @@ reftest.Runner = class {
|
|||||||
assert.positiveInteger(height);
|
assert.positiveInteger(height);
|
||||||
|
|
||||||
let reftestWin = this.parentWindow.open(
|
let reftestWin = this.parentWindow.open(
|
||||||
"chrome://marionette/content/reftest.xul",
|
"chrome://marionette/content/reftest.xhtml",
|
||||||
"reftest",
|
"reftest",
|
||||||
`chrome,height=${height},width=${width}`
|
`chrome,height=${height},width=${width}`
|
||||||
);
|
);
|
||||||
@ -157,7 +157,6 @@ reftest.Runner = class {
|
|||||||
browser = reftestWin.document.createElementNS(XUL_NS, "xul:browser");
|
browser = reftestWin.document.createElementNS(XUL_NS, "xul:browser");
|
||||||
browser.permanentKey = {};
|
browser.permanentKey = {};
|
||||||
browser.setAttribute("id", "browser");
|
browser.setAttribute("id", "browser");
|
||||||
browser.setAttribute("anonid", "initialBrowser");
|
|
||||||
browser.setAttribute("type", "content");
|
browser.setAttribute("type", "content");
|
||||||
browser.setAttribute("primary", "true");
|
browser.setAttribute("primary", "true");
|
||||||
if (this.remote) {
|
if (this.remote) {
|
||||||
|
@ -780,7 +780,7 @@ var BrowserTestUtils = {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
async function observer(subject, topic, data) {
|
async function observer(subject, topic, data) {
|
||||||
if (topic == "domwindowopened" && (!win || subject === win)) {
|
if (topic == "domwindowopened" && (!win || subject === win)) {
|
||||||
let observedWindow = subject.QueryInterface(Ci.nsIDOMWindow);
|
let observedWindow = subject;
|
||||||
if (checkFn && !(await checkFn(observedWindow))) {
|
if (checkFn && !(await checkFn(observedWindow))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -806,7 +806,7 @@ var BrowserTestUtils = {
|
|||||||
function observer(subject, topic, data) {
|
function observer(subject, topic, data) {
|
||||||
if (topic == "domwindowclosed" && (!win || subject === win)) {
|
if (topic == "domwindowclosed" && (!win || subject === win)) {
|
||||||
Services.ww.unregisterNotification(observer);
|
Services.ww.unregisterNotification(observer);
|
||||||
resolve(subject.QueryInterface(Ci.nsIDOMWindow));
|
resolve(subject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Services.ww.registerNotification(observer);
|
Services.ww.registerNotification(observer);
|
||||||
@ -2123,7 +2123,7 @@ var BrowserTestUtils = {
|
|||||||
*/
|
*/
|
||||||
async promiseAlertDialogOpen(
|
async promiseAlertDialogOpen(
|
||||||
buttonAction,
|
buttonAction,
|
||||||
uri = "chrome://global/content/commonDialog.xul",
|
uri = "chrome://global/content/commonDialog.xhtml",
|
||||||
func
|
func
|
||||||
) {
|
) {
|
||||||
let win = await this.domWindowOpened(null, async win => {
|
let win = await this.domWindowOpened(null, async win => {
|
||||||
@ -2140,8 +2140,8 @@ var BrowserTestUtils = {
|
|||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
let doc = win.document.documentElement;
|
let dialog = win.document.querySelector("dialog");
|
||||||
doc.getButton(buttonAction).click();
|
dialog.getButton(buttonAction).click();
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
},
|
},
|
||||||
@ -2161,7 +2161,7 @@ var BrowserTestUtils = {
|
|||||||
*/
|
*/
|
||||||
async promiseAlertDialog(
|
async promiseAlertDialog(
|
||||||
buttonAction,
|
buttonAction,
|
||||||
uri = "chrome://global/content/commonDialog.xul",
|
uri = "chrome://global/content/commonDialog.xhtml",
|
||||||
func
|
func
|
||||||
) {
|
) {
|
||||||
let win = await this.promiseAlertDialogOpen(buttonAction, uri, func);
|
let win = await this.promiseAlertDialogOpen(buttonAction, uri, func);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
|
|
||||||
[test_baselinecoverage.xul]
|
[test_baselinecoverage.xhtml]
|
||||||
run-if = ccov && verify
|
run-if = ccov && verify
|
@ -72,7 +72,7 @@
|
|||||||
try {
|
try {
|
||||||
logger = new MozillaFileLogger(gConfig.logFile)
|
logger = new MozillaFileLogger(gConfig.logFile)
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
dump("TEST-UNEXPECTED-FAIL | (browser-harness.xul) | " +
|
dump("TEST-UNEXPECTED-FAIL | (browser-harness.xhtml) | " +
|
||||||
"Error trying to log to " + gConfig.logFile + ": " + ex + "\n");
|
"Error trying to log to " + gConfig.logFile + ": " + ex + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
// Test timeout (seconds)
|
// Test timeout (seconds)
|
||||||
var gTimeoutSeconds = 45;
|
var gTimeoutSeconds = 45;
|
||||||
var gConfig;
|
var gConfig;
|
||||||
var gSaveInstrumentationData = null;
|
|
||||||
|
|
||||||
var { AppConstants } = ChromeUtils.import(
|
var { AppConstants } = ChromeUtils.import(
|
||||||
"resource://gre/modules/AppConstants.jsm"
|
"resource://gre/modules/AppConstants.jsm"
|
||||||
@ -96,7 +95,7 @@ function testInit() {
|
|||||||
|
|
||||||
Services.ww.openWindow(
|
Services.ww.openWindow(
|
||||||
window,
|
window,
|
||||||
"chrome://mochikit/content/browser-harness.xul",
|
"chrome://mochikit/content/browser-harness.xhtml",
|
||||||
"browserTest",
|
"browserTest",
|
||||||
"chrome,centerscreen,dialog=no,resizable,titlebar,toolbar=no,width=800,height=600",
|
"chrome,centerscreen,dialog=no,resizable,titlebar,toolbar=no,width=800,height=600",
|
||||||
sstring
|
sstring
|
||||||
@ -148,279 +147,6 @@ function testInit() {
|
|||||||
"chrome://mochikit/content/tests/SimpleTest/AsyncUtilsContent.js",
|
"chrome://mochikit/content/tests/SimpleTest/AsyncUtilsContent.js",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
var testSuite = Cc["@mozilla.org/process/environment;1"]
|
|
||||||
.getService(Ci.nsIEnvironment)
|
|
||||||
.get("TEST_SUITE");
|
|
||||||
if (testSuite == "browser-chrome-instrumentation") {
|
|
||||||
takeInstrumentation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function takeInstrumentation() {
|
|
||||||
let instrumentData = {
|
|
||||||
elements: {},
|
|
||||||
};
|
|
||||||
|
|
||||||
function pad(str, length) {
|
|
||||||
if (str.length >= length) {
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
return str + " ".repeat(length - str.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
function byCount(a, b) {
|
|
||||||
return b[1] - a[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSummaryText() {
|
|
||||||
let summary = [];
|
|
||||||
let allData = {};
|
|
||||||
for (let selector of Object.keys(instrumentData.elements)) {
|
|
||||||
allData[selector] = instrumentData.elements[selector];
|
|
||||||
}
|
|
||||||
|
|
||||||
let selectors = Object.keys(allData);
|
|
||||||
let elements = selectors.map(s => allData[s]);
|
|
||||||
|
|
||||||
let namespaceMap = new Map();
|
|
||||||
let bindingMap = new Map();
|
|
||||||
|
|
||||||
for (let element of elements) {
|
|
||||||
if (!bindingMap.has(element.binding)) {
|
|
||||||
bindingMap.set(element.binding, 1);
|
|
||||||
} else {
|
|
||||||
bindingMap.set(element.binding, bindingMap.get(element.binding) + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!namespaceMap.has(element.namespaceURI)) {
|
|
||||||
namespaceMap.set(element.namespaceURI, new Map());
|
|
||||||
}
|
|
||||||
|
|
||||||
let localNameMap = namespaceMap.get(element.namespaceURI);
|
|
||||||
if (!localNameMap.has(element.localName)) {
|
|
||||||
localNameMap.set(element.localName, 1);
|
|
||||||
} else {
|
|
||||||
localNameMap.set(
|
|
||||||
element.localName,
|
|
||||||
localNameMap.get(element.localName) + 1
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let [namespace, localNameMap] of namespaceMap) {
|
|
||||||
summary.push(`Elements in namespace ${namespace}`);
|
|
||||||
|
|
||||||
let entries = Array.from(localNameMap);
|
|
||||||
entries.sort(byCount);
|
|
||||||
for (let entry of entries) {
|
|
||||||
summary.push(` ${pad(entry[1] + "", 5)} ${entry[0]}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
summary.push("XBL bindings");
|
|
||||||
let bindings = Array.from(bindingMap);
|
|
||||||
bindings.sort(byCount);
|
|
||||||
let bindingsJSON = {};
|
|
||||||
for (let binding of bindings) {
|
|
||||||
summary.push(` ${pad(binding[1] + "", 5)} ${binding[0]}`);
|
|
||||||
if (binding[0]) {
|
|
||||||
bindingsJSON[binding[0].split("#")[1].split('"')[0]] = binding[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
summary.push("XBL bindings as JSON");
|
|
||||||
summary.push(JSON.stringify(bindingsJSON, null, 2));
|
|
||||||
|
|
||||||
return summary.join("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Saves instrumantation data
|
|
||||||
function saveData() {
|
|
||||||
let path = Cc["@mozilla.org/process/environment;1"]
|
|
||||||
.getService(Ci.nsIEnvironment)
|
|
||||||
.get("MOZ_UPLOAD_DIR");
|
|
||||||
let encoder = new TextEncoder();
|
|
||||||
|
|
||||||
let instrumentPath = OS.Path.join(path, "xulinstrument.txt");
|
|
||||||
OS.File.writeAtomic(
|
|
||||||
instrumentPath,
|
|
||||||
encoder.encode(JSON.stringify(instrumentData, null, 2))
|
|
||||||
);
|
|
||||||
|
|
||||||
let summaryPath = OS.Path.join(path, "xulsummary.txt");
|
|
||||||
OS.File.writeAtomic(summaryPath, encoder.encode(getSummaryText()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// An iterator over an element and its ancestors
|
|
||||||
function* elementPath(element) {
|
|
||||||
yield element;
|
|
||||||
while ((element = element.parentNode) && element instanceof Element) {
|
|
||||||
yield element;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the information we care about for an element
|
|
||||||
function getElementInfo(element) {
|
|
||||||
let style = element.ownerGlobal.getComputedStyle(element);
|
|
||||||
let binding = style && style.getPropertyValue("-moz-binding");
|
|
||||||
|
|
||||||
return {
|
|
||||||
namespaceURI: element.namespaceURI,
|
|
||||||
localName: element.localName,
|
|
||||||
binding: binding && binding != "none" ? binding : null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// The selector for just this element
|
|
||||||
function immediateSelector(element) {
|
|
||||||
if (
|
|
||||||
element.localName == "notificationbox" &&
|
|
||||||
element.parentNode &&
|
|
||||||
element.parentNode.id == "tabbrowser-tabpanels"
|
|
||||||
) {
|
|
||||||
// Don't do a full selector for a tabpanel's notificationbox
|
|
||||||
return element.localName;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
element.localName == "tab" &&
|
|
||||||
element.classList.contains("tabbrowser-tab")
|
|
||||||
) {
|
|
||||||
// Don't do a full selector for a tab
|
|
||||||
return element.localName;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (element.id) {
|
|
||||||
return `#${element.id}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let selector = element.localName;
|
|
||||||
|
|
||||||
if (element.classList.length) {
|
|
||||||
selector += `.${Array.from(element.classList).join(".")}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let attr of ["src", "label"]) {
|
|
||||||
if (element.hasAttribute(attr)) {
|
|
||||||
selector += `[${attr}=${JSON.stringify(element.getAttribute(attr))}]`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return selector;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The selector chain for the element
|
|
||||||
function elementSelector(element) {
|
|
||||||
return Array.from(elementPath(element))
|
|
||||||
.reverse()
|
|
||||||
.map(immediateSelector)
|
|
||||||
.join(" > ");
|
|
||||||
}
|
|
||||||
|
|
||||||
// An iterator over all elements in the window
|
|
||||||
function* windowElements(win) {
|
|
||||||
yield* elementDescendants(win.document.documentElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
// An iterator over an element and all of its descendants
|
|
||||||
function* elementDescendants(element) {
|
|
||||||
let walker = Cc["@mozilla.org/inspector/deep-tree-walker;1"].createInstance(
|
|
||||||
Ci.inIDeepTreeWalker
|
|
||||||
);
|
|
||||||
walker.showAnonymousContent = true;
|
|
||||||
walker.showSubDocuments = false;
|
|
||||||
walker.showDocumentsAsNodes = false;
|
|
||||||
walker.init(element, NodeFilter.SHOW_ELEMENT);
|
|
||||||
|
|
||||||
yield element;
|
|
||||||
while (walker.nextNode()) {
|
|
||||||
if (walker.currentNode instanceof Element) {
|
|
||||||
yield walker.currentNode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Checks if we've seen an element and if not adds it to the instrumentation data
|
|
||||||
function instrumentElement(element) {
|
|
||||||
if (element.__instrumentSeen) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let selector = elementSelector(element);
|
|
||||||
element.__instrumentSeen = true;
|
|
||||||
|
|
||||||
if (selector in instrumentData.elements) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
instrumentData.elements[selector] = getElementInfo(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instruments every element in a window
|
|
||||||
function scanWindow(win) {
|
|
||||||
Array.from(windowElements(win)).forEach(instrumentElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instruments every element in an element's descendants
|
|
||||||
function scanElement(element) {
|
|
||||||
Array.from(elementDescendants(element)).forEach(instrumentElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleMutation(mutation) {
|
|
||||||
if (mutation.type != "childList") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let node of mutation.addedNodes) {
|
|
||||||
if (node instanceof Element) {
|
|
||||||
scanElement(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Watches a window for new elements to instrument
|
|
||||||
function observeWindow(win) {
|
|
||||||
let observer = new MutationObserver(mutations => {
|
|
||||||
mutations.forEach(handleMutation);
|
|
||||||
});
|
|
||||||
|
|
||||||
observer.observe(win.document, {
|
|
||||||
childList: true,
|
|
||||||
subtree: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
win.addEventListener(
|
|
||||||
"unload",
|
|
||||||
() => {
|
|
||||||
observer.takeRecords().forEach(handleMutation);
|
|
||||||
},
|
|
||||||
{ once: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
scanWindow(window);
|
|
||||||
observeWindow(window);
|
|
||||||
gSaveInstrumentationData = saveData;
|
|
||||||
|
|
||||||
Services.ww.registerNotification((win, topic, data) => {
|
|
||||||
if (topic != "domwindowopened") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
win.addEventListener(
|
|
||||||
"load",
|
|
||||||
() => {
|
|
||||||
if (win.location.href != AppConstants.BROWSER_CHROME_URL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
scanWindow(win);
|
|
||||||
observeWindow(win);
|
|
||||||
},
|
|
||||||
{ once: true }
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isGenerator(value) {
|
function isGenerator(value) {
|
||||||
@ -637,11 +363,8 @@ Tester.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async promiseMainWindowReady() {
|
async promiseMainWindowReady() {
|
||||||
if (window.gBrowserInit && !gBrowserInit.idleTasksFinished) {
|
if (window.gBrowserInit) {
|
||||||
await this.TestUtils.topicObserved(
|
await window.gBrowserInit.idleTasksFinishedPromise;
|
||||||
"browser-idle-startup-tasks-finished",
|
|
||||||
subject => subject === window
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -680,7 +403,7 @@ Tester.prototype = {
|
|||||||
// Remove stale tabs
|
// Remove stale tabs
|
||||||
if (this.currentTest && window.gBrowser && gBrowser.tabs.length > 1) {
|
if (this.currentTest && window.gBrowser && gBrowser.tabs.length > 1) {
|
||||||
while (gBrowser.tabs.length > 1) {
|
while (gBrowser.tabs.length > 1) {
|
||||||
let lastTab = gBrowser.tabContainer.lastElementChild;
|
let lastTab = gBrowser.tabs[gBrowser.tabs.length - 1];
|
||||||
if (!lastTab.closing) {
|
if (!lastTab.closing) {
|
||||||
// Report the stale tab as an error only when they're not closing.
|
// Report the stale tab as an error only when they're not closing.
|
||||||
// Tests can finish without waiting for the closing tabs.
|
// Tests can finish without waiting for the closing tabs.
|
||||||
@ -793,10 +516,6 @@ Tester.prototype = {
|
|||||||
this.callback(this.tests);
|
this.callback(this.tests);
|
||||||
this.callback = null;
|
this.callback = null;
|
||||||
this.tests = null;
|
this.tests = null;
|
||||||
|
|
||||||
if (gSaveInstrumentationData) {
|
|
||||||
gSaveInstrumentationData();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
haltTests: function Tester_haltTests() {
|
haltTests: function Tester_haltTests() {
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
skip-if = os == 'android'
|
skip-if = os == 'android'
|
||||||
support-files = test-dir/test-file
|
support-files = test-dir/test-file
|
||||||
|
|
||||||
[test_sample.xul]
|
[test_sample.xhtml]
|
||||||
[test_sanityEventUtils.xul]
|
[test_sanityEventUtils.xhtml]
|
||||||
[test_sanityPluginUtils.html]
|
[test_sanityPluginUtils.html]
|
||||||
[test_sanityException.xul]
|
[test_sanityException.xhtml]
|
||||||
[test_sanityException2.xul]
|
[test_sanityException2.xhtml]
|
||||||
[test_sanityManifest.xul]
|
[test_sanityManifest.xhtml]
|
||||||
fail-if = true
|
fail-if = true
|
||||||
[test_sanityManifest_pf.xul]
|
[test_sanityManifest_pf.xhtml]
|
||||||
fail-if = true
|
fail-if = true
|
||||||
[test_chromeGetTestFile.xul]
|
[test_chromeGetTestFile.xhtml]
|
||||||
[test_tasks_skip.xul]
|
[test_tasks_skip.xhtml]
|
||||||
[test_tasks_skipall.xul]
|
[test_tasks_skipall.xhtml]
|
||||||
|
@ -17,21 +17,21 @@
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
SimpleTest.doesThrow(function () {
|
SimpleTest.doesThrow(function () {
|
||||||
getTestFilePath("/test_chromeGetTestFile.xul")
|
getTestFilePath("/test_chromeGetTestFile.xhtml")
|
||||||
}, "getTestFilePath rejects absolute paths");
|
}, "getTestFilePath rejects absolute paths");
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
OS.File.exists(getTestFilePath("test_chromeGetTestFile.xul"))
|
OS.File.exists(getTestFilePath("test_chromeGetTestFile.xhtml"))
|
||||||
.then(function (exists) {
|
.then(function (exists) {
|
||||||
ok(exists, "getTestFilePath consider the path as being relative");
|
ok(exists, "getTestFilePath consider the path as being relative");
|
||||||
}),
|
}),
|
||||||
|
|
||||||
OS.File.exists(getTestFilePath("./test_chromeGetTestFile.xul"))
|
OS.File.exists(getTestFilePath("./test_chromeGetTestFile.xhtml"))
|
||||||
.then(function (exists) {
|
.then(function (exists) {
|
||||||
ok(exists, "getTestFilePath also accepts explicit relative path");
|
ok(exists, "getTestFilePath also accepts explicit relative path");
|
||||||
}),
|
}),
|
||||||
|
|
||||||
OS.File.exists(getTestFilePath("./test_chromeGetTestFileTypo.xul"))
|
OS.File.exists(getTestFilePath("./test_chromeGetTestFileTypo.xhtml"))
|
||||||
.then(function (exists) {
|
.then(function (exists) {
|
||||||
ok(!exists, "getTestFilePath do not throw if the file doesn't exists");
|
ok(!exists, "getTestFilePath do not throw if the file doesn't exists");
|
||||||
}),
|
}),
|
@ -106,24 +106,6 @@
|
|||||||
var startTime = new Date();
|
var startTime = new Date();
|
||||||
var result;
|
var result;
|
||||||
|
|
||||||
/* test synthesizeDragStart */
|
|
||||||
result = synthesizeDragStart($("drag1"), drag1, window);
|
|
||||||
is(result, null, "drag1 is text/uri-list");
|
|
||||||
result = synthesizeDragStart($("drag1"), drag1WrongFlavor, window);
|
|
||||||
isnot(result, null, "drag1 is not text/plain");
|
|
||||||
result = synthesizeDragStart($("drag1"), drag2items, window);
|
|
||||||
isnot(result, null, "drag1 is not 2 items");
|
|
||||||
result = synthesizeDragStart($("drag2"), drag2, window);
|
|
||||||
is(result, null, "drag2 is ordered text/plain then text/uri-list");
|
|
||||||
result = synthesizeDragStart($("drag2"), drag1, window);
|
|
||||||
isnot(result, null, "drag2 is not one flavor");
|
|
||||||
result = synthesizeDragStart($("drag2"), drag2WrongOrder, window);
|
|
||||||
isnot(result, null, "drag2 is not ordered text/uri-list then text/plain");
|
|
||||||
result = synthesizeDragStart($("dragfile"), dragfile, window);
|
|
||||||
is(result, null, "dragfile is nsIFile");
|
|
||||||
result = synthesizeDragStart($("drag1"), null, window);
|
|
||||||
is(result, regularDtForDrag1, "synthesizeDragStart accepts null expectedDragData");
|
|
||||||
|
|
||||||
/* test synthesizeDrop */
|
/* test synthesizeDrop */
|
||||||
result = synthesizeDrop($("dragDrop"), $("dragDrop"), dragDrop, null, window);
|
result = synthesizeDrop($("dragDrop"), $("dragDrop"), dragDrop, null, window);
|
||||||
ok(gEnter, "Fired dragenter");
|
ok(gEnter, "Fired dragenter");
|
@ -189,7 +189,7 @@ class ShutdownLeaks(object):
|
|||||||
|
|
||||||
def _isHiddenWindowURL(self, url):
|
def _isHiddenWindowURL(self, url):
|
||||||
return (url == "resource://gre-resources/hiddenWindow.html" or # Win / Linux
|
return (url == "resource://gre-resources/hiddenWindow.html" or # Win / Linux
|
||||||
url == "chrome://browser/content/hiddenWindow.xul") # Mac
|
url == "chrome://browser/content/hiddenWindowMac.xhtml") # Mac
|
||||||
|
|
||||||
|
|
||||||
class LSANLeaks(object):
|
class LSANLeaks(object):
|
||||||
|
@ -539,12 +539,6 @@ class MochitestArguments(ArgumentContainer):
|
|||||||
"help": "Filter out tests that don't have the given tag. Can be used multiple "
|
"help": "Filter out tests that don't have the given tag. Can be used multiple "
|
||||||
"times in which case the test must contain at least one of the given tags.",
|
"times in which case the test must contain at least one of the given tags.",
|
||||||
}],
|
}],
|
||||||
[["--enable-cpow-warnings"],
|
|
||||||
{"action": "store_true",
|
|
||||||
"dest": "enableCPOWWarnings",
|
|
||||||
"help": "Enable logging of unsafe CPOW usage, which is disabled by default for tests",
|
|
||||||
"suppress": True,
|
|
||||||
}],
|
|
||||||
[["--marionette"],
|
[["--marionette"],
|
||||||
{"default": None,
|
{"default": None,
|
||||||
"help": "host:port to use when connecting to Marionette",
|
"help": "host:port to use when connecting to Marionette",
|
||||||
|
@ -20,11 +20,11 @@ FINAL_TARGET_FILES += [
|
|||||||
]
|
]
|
||||||
|
|
||||||
FINAL_TARGET_FILES.content += [
|
FINAL_TARGET_FILES.content += [
|
||||||
'browser-harness.xul',
|
'browser-harness.xhtml',
|
||||||
'browser-test.js',
|
'browser-test.js',
|
||||||
'chrome-harness.js',
|
'chrome-harness.js',
|
||||||
'chunkifyTests.js',
|
'chunkifyTests.js',
|
||||||
'harness.xul',
|
'harness.xhtml',
|
||||||
'manifestLibrary.js',
|
'manifestLibrary.js',
|
||||||
'mochitest-e10s-utils.js',
|
'mochitest-e10s-utils.js',
|
||||||
'nested_setup.js',
|
'nested_setup.js',
|
||||||
@ -94,12 +94,12 @@ TEST_HARNESS_FILES.testing.mochitest += [
|
|||||||
'/build/valgrind/x86_64-pc-linux-gnu.sup',
|
'/build/valgrind/x86_64-pc-linux-gnu.sup',
|
||||||
'/netwerk/test/httpserver/httpd.js',
|
'/netwerk/test/httpserver/httpd.js',
|
||||||
'bisection.py',
|
'bisection.py',
|
||||||
'browser-harness.xul',
|
'browser-harness.xhtml',
|
||||||
'browser-test.js',
|
'browser-test.js',
|
||||||
'chrome-harness.js',
|
'chrome-harness.js',
|
||||||
'chunkifyTests.js',
|
'chunkifyTests.js',
|
||||||
'favicon.ico',
|
'favicon.ico',
|
||||||
'harness.xul',
|
'harness.xhtml',
|
||||||
'leaks.py',
|
'leaks.py',
|
||||||
'mach_test_package_commands.py',
|
'mach_test_package_commands.py',
|
||||||
'manifest.webapp',
|
'manifest.webapp',
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function redirectToHarness() {
|
function redirectToHarness() {
|
||||||
redirect("chrome://mochikit/content/harness.xul");
|
redirect("chrome://mochikit/content/harness.xhtml");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLoad() {
|
function onLoad() {
|
||||||
|
@ -81,9 +81,15 @@ function starttest(){
|
|||||||
|
|
||||||
// QueryInterface and getPrivilegedProps tests
|
// QueryInterface and getPrivilegedProps tests
|
||||||
is(SpecialPowers.can_QI(SpecialPowers), false);
|
is(SpecialPowers.can_QI(SpecialPowers), false);
|
||||||
ok(SpecialPowers.can_QI(window));
|
let doc = SpecialPowers.wrap(document);
|
||||||
ok(SpecialPowers.do_QueryInterface(window, "nsIDOMWindow"));
|
is(SpecialPowers.getPrivilegedProps(doc, "baseURIObject.fileName"), null,
|
||||||
is(SpecialPowers.getPrivilegedProps(SpecialPowers.do_QueryInterface(window, "nsIDOMWindow"), "document.nodeName"), "#document");
|
"Should not have a fileName property yet");
|
||||||
|
let uri = SpecialPowers.getPrivilegedProps(doc, "baseURIObject");
|
||||||
|
ok(SpecialPowers.can_QI(uri));
|
||||||
|
ok(SpecialPowers.do_QueryInterface(uri, "nsIURL"));
|
||||||
|
is(SpecialPowers.getPrivilegedProps(doc, "baseURIObject.fileName"),
|
||||||
|
"test_SpecialPowersExtension.html",
|
||||||
|
"Should have a fileName property now");
|
||||||
|
|
||||||
//try to run garbage collection
|
//try to run garbage collection
|
||||||
SpecialPowers.gc();
|
SpecialPowers.gc();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -138,4 +138,18 @@ ExtensionTestUtils.loadExtension = function(ext)
|
|||||||
|
|
||||||
SimpleTest.info(`Extension loaded`);
|
SimpleTest.info(`Extension loaded`);
|
||||||
return extension;
|
return extension;
|
||||||
|
};
|
||||||
|
|
||||||
|
ExtensionTestUtils.failOnSchemaWarnings = (warningsAsErrors = true) => {
|
||||||
|
let prefName = "extensions.webextensions.warnings-as-errors";
|
||||||
|
SpecialPowers.setBoolPref(prefName, warningsAsErrors);
|
||||||
|
if (!warningsAsErrors) {
|
||||||
|
let registerCleanup;
|
||||||
|
if (typeof registerCleanupFunction != "undefined") {
|
||||||
|
registerCleanup = registerCleanupFunction;
|
||||||
|
} else {
|
||||||
|
registerCleanup = SimpleTest.registerCleanupFunction.bind(SimpleTest);
|
||||||
}
|
}
|
||||||
|
registerCleanup(() => SpecialPowers.setBoolPref(prefName, true));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -31,8 +31,8 @@ try {
|
|||||||
// case it is not defined) from a parent/opener window.
|
// case it is not defined) from a parent/opener window.
|
||||||
//
|
//
|
||||||
// Finding the SpecialPowers object is needed when we have ChromePowers in
|
// Finding the SpecialPowers object is needed when we have ChromePowers in
|
||||||
// harness.xul and we need SpecialPowers in the iframe, and also for tests
|
// harness.xhtml and we need SpecialPowers in the iframe, and also for tests
|
||||||
// like test_focus.xul where we open a window which opens another window which
|
// like test_focus.xhtml where we open a window which opens another window which
|
||||||
// includes SimpleTest.js.
|
// includes SimpleTest.js.
|
||||||
(function() {
|
(function() {
|
||||||
function ancestor(w) {
|
function ancestor(w) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'"></meta>
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'"></meta>
|
||||||
<title>This is a dummy page</title>
|
<title>This is a dummy page</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<body>This is a dummy page</body>
|
<body>This is a dummy page</body>
|
||||||
|
@ -141,6 +141,9 @@ def test_environment(xrePath, env=None, crashreporter=True, debugger=False,
|
|||||||
env.setdefault('R_LOG_DESTINATION', 'stderr')
|
env.setdefault('R_LOG_DESTINATION', 'stderr')
|
||||||
env.setdefault('R_LOG_VERBOSE', '1')
|
env.setdefault('R_LOG_VERBOSE', '1')
|
||||||
|
|
||||||
|
# Ask NSS to use lower-security password encryption. See Bug 1594559
|
||||||
|
env.setdefault('NSS_MAX_MP_PBE_ITERATION_COUNT', '10')
|
||||||
|
|
||||||
# ASan specific environment stuff
|
# ASan specific environment stuff
|
||||||
asan = bool(mozinfo.info.get("asan"))
|
asan = bool(mozinfo.info.get("asan"))
|
||||||
if asan:
|
if asan:
|
||||||
|
@ -169,7 +169,6 @@ config = {
|
|||||||
"mochitest-browser-chrome-chunked": ["--flavor=browser", "--chunk-by-runtime"],
|
"mochitest-browser-chrome-chunked": ["--flavor=browser", "--chunk-by-runtime"],
|
||||||
"mochitest-browser-chrome-coverage": ["--flavor=browser", "--chunk-by-runtime", "--timeout=1200"],
|
"mochitest-browser-chrome-coverage": ["--flavor=browser", "--chunk-by-runtime", "--timeout=1200"],
|
||||||
"mochitest-browser-chrome-screenshots": ["--flavor=browser", "--subsuite=screenshots"],
|
"mochitest-browser-chrome-screenshots": ["--flavor=browser", "--subsuite=screenshots"],
|
||||||
"mochitest-browser-chrome-instrumentation": ["--flavor=browser"],
|
|
||||||
"mochitest-webgl1-core": ["--subsuite=webgl1-core"],
|
"mochitest-webgl1-core": ["--subsuite=webgl1-core"],
|
||||||
"mochitest-webgl1-ext": ["--subsuite=webgl1-ext"],
|
"mochitest-webgl1-ext": ["--subsuite=webgl1-ext"],
|
||||||
"mochitest-webgl2-core": ["--subsuite=webgl2-core"],
|
"mochitest-webgl2-core": ["--subsuite=webgl2-core"],
|
||||||
|
@ -136,7 +136,6 @@ config = {
|
|||||||
"mochitest-browser-chrome": ["--flavor=browser"],
|
"mochitest-browser-chrome": ["--flavor=browser"],
|
||||||
"mochitest-browser-chrome-chunked": ["--flavor=browser", "--chunk-by-runtime"],
|
"mochitest-browser-chrome-chunked": ["--flavor=browser", "--chunk-by-runtime"],
|
||||||
"mochitest-browser-chrome-screenshots": ["--flavor=browser", "--subsuite=screenshots"],
|
"mochitest-browser-chrome-screenshots": ["--flavor=browser", "--subsuite=screenshots"],
|
||||||
"mochitest-browser-chrome-instrumentation": ["--flavor=browser"],
|
|
||||||
"mochitest-webgl1-core": ["--subsuite=webgl1-core"],
|
"mochitest-webgl1-core": ["--subsuite=webgl1-core"],
|
||||||
"mochitest-webgl1-ext": ["--subsuite=webgl1-ext"],
|
"mochitest-webgl1-ext": ["--subsuite=webgl1-ext"],
|
||||||
"mochitest-webgl2-core": ["--subsuite=webgl2-core"],
|
"mochitest-webgl2-core": ["--subsuite=webgl2-core"],
|
||||||
|
@ -159,7 +159,6 @@ config = {
|
|||||||
"mochitest-browser-chrome": ["--flavor=browser"],
|
"mochitest-browser-chrome": ["--flavor=browser"],
|
||||||
"mochitest-browser-chrome-chunked": ["--flavor=browser", "--chunk-by-runtime"],
|
"mochitest-browser-chrome-chunked": ["--flavor=browser", "--chunk-by-runtime"],
|
||||||
"mochitest-browser-chrome-screenshots": ["--flavor=browser", "--subsuite=screenshots"],
|
"mochitest-browser-chrome-screenshots": ["--flavor=browser", "--subsuite=screenshots"],
|
||||||
"mochitest-browser-chrome-instrumentation": ["--flavor=browser"],
|
|
||||||
"mochitest-webgl1-core": ["--subsuite=webgl1-core"],
|
"mochitest-webgl1-core": ["--subsuite=webgl1-core"],
|
||||||
"mochitest-webgl1-ext": ["--subsuite=webgl1-ext"],
|
"mochitest-webgl1-ext": ["--subsuite=webgl1-ext"],
|
||||||
"mochitest-webgl2-core": ["--subsuite=webgl2-core"],
|
"mochitest-webgl2-core": ["--subsuite=webgl2-core"],
|
||||||
|
@ -188,8 +188,8 @@ class CodeCoverageMixin(SingleTestMixin):
|
|||||||
'test': 'testing/mochitest/baselinecoverage/browser_chrome/browser_baselinecoverage.js', # NOQA: E501
|
'test': 'testing/mochitest/baselinecoverage/browser_chrome/browser_baselinecoverage.js', # NOQA: E501
|
||||||
'suite': 'mochitest-browser-chrome'
|
'suite': 'mochitest-browser-chrome'
|
||||||
},
|
},
|
||||||
'.xul': {
|
'.xhtml': {
|
||||||
'test': 'testing/mochitest/baselinecoverage/chrome/test_baselinecoverage.xul',
|
'test': 'testing/mochitest/baselinecoverage/chrome/test_baselinecoverage.xhtml',
|
||||||
'suite': 'mochitest-chrome'
|
'suite': 'mochitest-chrome'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,4 +57,3 @@ user_pref("media.allowed-to-play.enabled", true);
|
|||||||
// Ensure media can always play without delay
|
// Ensure media can always play without delay
|
||||||
user_pref("media.block-autoplay-until-in-foreground", false);
|
user_pref("media.block-autoplay-until-in-foreground", false);
|
||||||
user_pref("toolkit.telemetry.coverage.endpoint.base", "http://localhost");
|
user_pref("toolkit.telemetry.coverage.endpoint.base", "http://localhost");
|
||||||
user_pref("layout.css.moz-binding.content.enabled", true); // Le sad
|
|
||||||
|
@ -3,3 +3,7 @@
|
|||||||
|
|
||||||
// disk cache smart size is enabled in shipped apps
|
// disk cache smart size is enabled in shipped apps
|
||||||
user_pref("browser.cache.disk.smart_size.enabled", true);
|
user_pref("browser.cache.disk.smart_size.enabled", true);
|
||||||
|
|
||||||
|
// Raptor's manifest.json contains the "geckoProfiler" permission, which is
|
||||||
|
// not supported on Android. Ignore the warning about the unknown permission.
|
||||||
|
user_pref("extensions.webextensions.warnings-as-errors", false);
|
||||||
|
@ -61,9 +61,9 @@ XPCOMUtils.defineLazyServiceGetter(
|
|||||||
);
|
);
|
||||||
|
|
||||||
async function talosStart() {
|
async function talosStart() {
|
||||||
// Tests are driven from pageloader.xul. We need to be careful to open
|
// Tests are driven from pageloader.xhtml. We need to be careful to open
|
||||||
// pageloader.xul before dismissing the default browser window or we
|
// pageloader.xhtml before dismissing the default browser window or we
|
||||||
// may inadvertently cause the browser to exit before the pageloader.xul
|
// may inadvertently cause the browser to exit before the pageloader.xhtml
|
||||||
// window is opened. Start by finding or waiting for the default window.
|
// window is opened. Start by finding or waiting for the default window.
|
||||||
let defaultWin = Services.wm.getMostRecentWindow("navigator:browser");
|
let defaultWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||||
if (!defaultWin) {
|
if (!defaultWin) {
|
||||||
@ -84,8 +84,8 @@ async function talosStart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wwe've got the default window, it is time for pageloader to take over.
|
// Wwe've got the default window, it is time for pageloader to take over.
|
||||||
// Open pageloader.xul in a new window and then close the default window.
|
// Open pageloader.xhtml in a new window and then close the default window.
|
||||||
let chromeURL = "chrome://pageloader/content/pageloader.xul";
|
let chromeURL = "chrome://pageloader/content/pageloader.xhtml";
|
||||||
|
|
||||||
let args = {};
|
let args = {};
|
||||||
args.wrappedJSObject = args;
|
args.wrappedJSObject = args;
|
||||||
|
@ -6193,9 +6193,6 @@
|
|||||||
"startTime": 1393256133774,
|
"startTime": 1393256133774,
|
||||||
"recentCrashes": 0
|
"recentCrashes": 0
|
||||||
},
|
},
|
||||||
"scratchpads": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"global": {
|
"global": {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user