Bug 1064421: Clean up setWindowSize tests and add support for Fennec; r=jgriffin

This commit is contained in:
David Burns 2014-09-19 00:26:54 +01:00
parent 14d5104765
commit 7cfc5ee0d7
2 changed files with 8 additions and 3 deletions

View File

@ -22,7 +22,7 @@ class TestSetWindowSize(MarionetteTestCase):
self.marionette.set_window_size(self.start_size['width'], self.start_size['height'])
super(MarionetteTestCase, self).tearDown()
def test_set_window_size(self):
def test_that_we_can_get_and_set_window_size(self):
# event handler
self.marionette.execute_script("""
window.wrappedJSObject.rcvd_event = false;
@ -42,6 +42,11 @@ class TestSetWindowSize(MarionetteTestCase):
self.assertEqual(size['height'], height,
"Window height is %s but should be %s" % (size['height'], height))
def test_that_we_throw_an_error_when_trying_to_set_maximum_size(self):
# valid size
width = self.max_width - 100
height = self.max_height - 100
self.marionette.set_window_size(width, height)
# invalid size (cannot maximize)
with self.assertRaisesRegexp(MarionetteException, "Invalid requested size"):
self.marionette.set_window_size(self.max_width, self.max_height)

View File

@ -2420,8 +2420,8 @@ MarionetteServerConnection.prototype = {
setWindowSize: function MDA_setWindowSize(aRequest) {
this.command_id = this.getCommandId();
if (appName == "B2G") {
this.sendError("Not supported on B2G", 405, null, this.command_id);
if (appName !== "Firefox") {
this.sendError("Not supported on mobile", 405, null, this.command_id);
return;
}