Beispiel #1
0
    def test_macosx_display_window_flags_state(self):
        """
        Test that on Mac OS X we set the proper window flags
        """
        # GIVEN: A new SlideController instance on Mac OS X.
        self.screens.set_current_display(0)
        display = MagicMock()

        # WHEN: The default controller is built.
        main_display = MainDisplay(display)

        # THEN: The window flags should be the same as those needed on Mac OS X.
        assert QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint | QtCore.Qt.NoDropShadowWindowHint == \
            main_display.windowFlags(), \
            'The window flags should be Qt.Window, Qt.FramelessWindowHint, and Qt.NoDropShadowWindowHint.'
Beispiel #2
0
    def test_macosx_display_window_flags_state(self):
        """
        Test that on Mac OS X we set the proper window flags
        """
        # GIVEN: A new SlideController instance on Mac OS X.
        self.screens.set_current_display(0)
        display = MagicMock()

        # WHEN: The default controller is built.
        main_display = MainDisplay(display)

        # THEN: The window flags should be the same as those needed on Mac OS X.
        self.assertEqual(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint,
                         main_display.windowFlags(),
                         'The window flags should be Qt.Window, and Qt.FramelessWindowHint.')
Beispiel #3
0
    def macosx_primary_screen_window_flags_state_test(self, is_macosx):
        """
        Test that on Mac OS X when the current screen is primary we set the proper window flags and window state
        """
        # GIVEN: A new SlideController instance on Mac OS X with the current display being primary.
        is_macosx.return_value = True
        self.screens.set_current_display(0)
        display = MagicMock()

        # WHEN: The default controller is built.
        main_display = MainDisplay(display)

        # THEN: The window flags and state should be the same as those needed on Mac OS X for the primary display.
        self.assertEqual(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint, main_display.windowFlags(),
                         'The window flags should be Qt.Window and Qt.FramelessWindowHint.')
        self.assertEqual(QtCore.Qt.WindowFullScreen, main_display.windowState(),
                         'The window state should be full screen.')