test_window_maximize.py (1207B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 from marionette_harness import MarionetteTestCase 6 7 8 class TestWindowMaximize(MarionetteTestCase): 9 def setUp(self): 10 MarionetteTestCase.setUp(self) 11 self.max = self.marionette.execute_script( 12 """ 13 return { 14 width: window.screen.availWidth, 15 height: window.screen.availHeight, 16 }""", 17 sandbox=None, 18 ) 19 20 # ensure window is not maximized 21 self.marionette.set_window_rect( 22 width=self.max["width"] - 100, height=self.max["height"] - 100 23 ) 24 actual = self.marionette.window_rect 25 self.assertNotEqual(actual["width"], self.max["width"]) 26 self.assertNotEqual(actual["height"], self.max["height"]) 27 28 self.original_size = actual 29 30 def tearDown(self): 31 self.marionette.set_window_rect( 32 width=self.original_size["width"], height=self.original_size["height"] 33 ) 34 35 def test_maximize(self): 36 self.marionette.maximize_window()