| Index: chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
|
| diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
|
| index 82b35a284c5f55c4d7268fcfc9016478c70f4662..63043506369ee4a4672319420b667f04add4030b 100644
|
| --- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
|
| +++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_unittest.cc
|
| @@ -51,11 +51,11 @@ class FullscreenControllerTestWindow : public TestBrowserWindow {
|
| virtual bool IsInMetroSnapMode() const OVERRIDE;
|
| #endif
|
| #if defined(OS_MACOSX)
|
| - virtual void EnterPresentationMode(
|
| + virtual void EnterFullscreenWithChrome(
|
| const GURL& url,
|
| FullscreenExitBubbleType bubble_type) OVERRIDE;
|
| - virtual void ExitPresentationMode() OVERRIDE;
|
| - virtual bool InPresentationMode() OVERRIDE;
|
| + virtual bool IsFullscreenWithChrome() OVERRIDE;
|
| + virtual bool IsFullscreenWithoutChrome() OVERRIDE;
|
| #endif
|
|
|
| static const char* GetWindowStateString(WindowState state);
|
| @@ -71,7 +71,7 @@ class FullscreenControllerTestWindow : public TestBrowserWindow {
|
|
|
| private:
|
| WindowState state_;
|
| - bool mac_presentation_mode_;
|
| + bool mac_with_chrome_mode_;
|
| Browser* browser_;
|
|
|
| // Causes reentrant calls to be made by calling
|
| @@ -82,7 +82,7 @@ class FullscreenControllerTestWindow : public TestBrowserWindow {
|
|
|
| FullscreenControllerTestWindow::FullscreenControllerTestWindow()
|
| : state_(NORMAL),
|
| - mac_presentation_mode_(false),
|
| + mac_with_chrome_mode_(false),
|
| browser_(NULL),
|
| reentrant_(false) {
|
| }
|
| @@ -93,6 +93,7 @@ void FullscreenControllerTestWindow::EnterFullscreen(
|
| }
|
|
|
| void FullscreenControllerTestWindow::EnterFullscreen() {
|
| + mac_with_chrome_mode_ = false;
|
| if (!IsFullscreen()) {
|
| state_ = TO_FULLSCREEN;
|
| ChangeWindowFullscreenStateIfReentrant();
|
| @@ -102,7 +103,7 @@ void FullscreenControllerTestWindow::EnterFullscreen() {
|
| void FullscreenControllerTestWindow::ExitFullscreen() {
|
| if (IsFullscreen()) {
|
| state_ = TO_NORMAL;
|
| - mac_presentation_mode_ = false;
|
| + mac_with_chrome_mode_ = false;
|
| ChangeWindowFullscreenStateIfReentrant();
|
| }
|
| }
|
| @@ -132,22 +133,19 @@ bool FullscreenControllerTestWindow::IsInMetroSnapMode() const {
|
| #endif
|
|
|
| #if defined(OS_MACOSX)
|
| -void FullscreenControllerTestWindow::EnterPresentationMode(
|
| +void FullscreenControllerTestWindow::EnterFullscreenWithChrome(
|
| const GURL& url,
|
| FullscreenExitBubbleType bubble_type) {
|
| - mac_presentation_mode_ = true;
|
| EnterFullscreen();
|
| + mac_with_chrome_mode_ = true;
|
| }
|
|
|
| -void FullscreenControllerTestWindow::ExitPresentationMode() {
|
| - if (InPresentationMode()) {
|
| - mac_presentation_mode_ = false;
|
| - ExitFullscreen();
|
| - }
|
| +bool FullscreenControllerTestWindow::IsFullscreenWithChrome() {
|
| + return IsFullscreen() && mac_with_chrome_mode_;
|
| }
|
|
|
| -bool FullscreenControllerTestWindow::InPresentationMode() {
|
| - return mac_presentation_mode_;
|
| +bool FullscreenControllerTestWindow::IsFullscreenWithoutChrome() {
|
| + return IsFullscreen() && !mac_with_chrome_mode_;
|
| }
|
| #endif
|
|
|
| @@ -331,6 +329,24 @@ Browser* FullscreenControllerStateUnitTest::GetBrowser() {
|
| TEST_EVENT_INNER(state, event, false, ); \
|
| TEST_EVENT_INNER(state, event, true, _Reentrant);
|
|
|
| +// Soak tests:
|
| +
|
| +// Tests all states with all permutations of multiple events to detect lingering
|
| +// state issues that would bleed over to other states.
|
| +// I.E. for each state test all combinations of events E1, E2, E3.
|
| +//
|
| +// This produces coverage for event sequences that may happen normally but
|
| +// would not be exposed by traversing to each state via TransitionToState().
|
| +// TransitionToState() always takes the same path even when multiple paths
|
| +// exist.
|
| +TEST_F(FullscreenControllerStateUnitTest, TransitionsForEachState) {
|
| + // A tab is needed for tab fullscreen.
|
| + AddTab(browser(), GURL(chrome::kAboutBlankURL));
|
| + TestTransitionsForEachState();
|
| + // Progress of test can be examined via LOG(INFO) << GetAndClearDebugLog();
|
| +}
|
| +
|
| +
|
| // Individual tests for each pair of state and event:
|
|
|
| TEST_EVENT(STATE_NORMAL, TOGGLE_FULLSCREEN);
|
| @@ -462,20 +478,3 @@ TEST_F(FullscreenControllerStateUnitTest, DISABLED_ToggleTabWhenPendingTab) {
|
| #endif
|
| }
|
|
|
| -// Soak tests:
|
| -
|
| -// Tests all states with all permutations of multiple events to detect lingering
|
| -// state issues that would bleed over to other states.
|
| -// I.E. for each state test all combinations of events E1, E2, E3.
|
| -//
|
| -// This produces coverage for event sequences that may happen normally but
|
| -// would not be exposed by traversing to each state via TransitionToState().
|
| -// TransitionToState() always takes the same path even when multiple paths
|
| -// exist.
|
| -TEST_F(FullscreenControllerStateUnitTest, TransitionsForEachState) {
|
| - // A tab is needed for tab fullscreen.
|
| - AddTab(browser(), GURL(chrome::kAboutBlankURL));
|
| - TestTransitionsForEachState();
|
| - // Progress of test can be examined via LOG(INFO) << GetAndClearDebugLog();
|
| -}
|
| -
|
|
|