| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h" | 5 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h" |
| 6 | 6 |
| 7 #include <memory.h> | 7 #include <memory.h> |
| 8 | 8 |
| 9 #include <iomanip> | 9 #include <iomanip> |
| 10 #include <iostream> | 10 #include <iostream> |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 VerifyWindowState(); | 337 VerifyWindowState(); |
| 338 | 338 |
| 339 return true; | 339 return true; |
| 340 } | 340 } |
| 341 | 341 |
| 342 void FullscreenControllerStateTest::VerifyWindowState() { | 342 void FullscreenControllerStateTest::VerifyWindowState() { |
| 343 switch (state_) { | 343 switch (state_) { |
| 344 case STATE_NORMAL: | 344 case STATE_NORMAL: |
| 345 #if defined(OS_MACOSX) | 345 #if defined(OS_MACOSX) |
| 346 EXPECT_FALSE(GetBrowser()->window()->InPresentationMode()) | 346 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome()) |
| 347 << GetAndClearDebugLog(); |
| 348 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome()) |
| 347 << GetAndClearDebugLog(); | 349 << GetAndClearDebugLog(); |
| 348 #endif | 350 #endif |
| 349 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser()) | 351 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser()) |
| 350 << GetAndClearDebugLog(); | 352 << GetAndClearDebugLog(); |
| 351 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending()) | 353 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending()) |
| 352 << GetAndClearDebugLog(); | 354 << GetAndClearDebugLog(); |
| 353 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) | 355 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) |
| 354 << GetAndClearDebugLog(); | 356 << GetAndClearDebugLog(); |
| 355 break; | 357 break; |
| 356 case STATE_BROWSER_FULLSCREEN_NO_CHROME: | 358 case STATE_BROWSER_FULLSCREEN_NO_CHROME: |
| 357 #if defined(OS_MACOSX) | 359 #if defined(OS_MACOSX) |
| 358 EXPECT_FALSE(GetBrowser()->window()->InPresentationMode()) | 360 // http://crbug.com/169138 - Fullscreen controller currently transitions |
| 361 // Mac into fullscreen with and without chrome differently than other |
| 362 // platforms, and the result is a name mismatch between the named |
| 363 // state_ and the window()->IsFullscreenWith...() methods. |
| 364 EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithChrome()) |
| 365 << GetAndClearDebugLog(); |
| 366 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome()) |
| 359 << GetAndClearDebugLog(); | 367 << GetAndClearDebugLog(); |
| 360 #endif | 368 #endif |
| 361 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser()) | 369 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser()) |
| 362 << GetAndClearDebugLog(); | 370 << GetAndClearDebugLog(); |
| 363 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending()) | 371 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForTabOrPending()) |
| 364 << GetAndClearDebugLog(); | 372 << GetAndClearDebugLog(); |
| 365 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) | 373 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) |
| 366 << GetAndClearDebugLog(); | 374 << GetAndClearDebugLog(); |
| 367 break; | 375 break; |
| 368 #if defined(OS_WIN) | 376 #if defined(OS_WIN) |
| 369 case STATE_METRO_SNAP: | 377 case STATE_METRO_SNAP: |
| 370 // No expectation for InPresentationMode. | 378 // http://crbug.com/169138 |
| 379 // No expectation for IsFullscreenWithChrome() or |
| 380 // IsFullscreenWithoutChrome() |
| 371 | 381 |
| 372 // TODO(scheib) IsFullscreenForBrowser and IsFullscreenForTabOrPending | 382 // TODO(scheib) IsFullscreenForBrowser and IsFullscreenForTabOrPending |
| 373 // are returning true and false in interactive tests with real window. | 383 // are returning true and false in interactive tests with real window. |
| 374 // With only a single Metro Snap state in this test framework it isn't | 384 // With only a single Metro Snap state in this test framework it isn't |
| 375 // fair to try to have an expectation anyway. | 385 // fair to try to have an expectation anyway. |
| 376 // | 386 // |
| 377 // No expectation for IsFullscreenForBrowser. | 387 // No expectation for IsFullscreenForBrowser. |
| 378 // No expectation for IsFullscreenForTabOrPending. | 388 // No expectation for IsFullscreenForTabOrPending. |
| 379 EXPECT_TRUE(GetFullscreenController()->IsInMetroSnapMode()) | 389 EXPECT_TRUE(GetFullscreenController()->IsInMetroSnapMode()) |
| 380 << GetAndClearDebugLog(); | 390 << GetAndClearDebugLog(); |
| 381 break; | 391 break; |
| 382 #endif | 392 #endif |
| 383 case STATE_TAB_FULLSCREEN: | 393 case STATE_TAB_FULLSCREEN: |
| 384 #if defined(OS_MACOSX) | 394 #if defined(OS_MACOSX) |
| 385 EXPECT_TRUE(GetBrowser()->window()->InPresentationMode()) | 395 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome()) |
| 396 << GetAndClearDebugLog(); |
| 397 EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithoutChrome()) |
| 386 << GetAndClearDebugLog(); | 398 << GetAndClearDebugLog(); |
| 387 #endif | 399 #endif |
| 388 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser()) | 400 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser()) |
| 389 << GetAndClearDebugLog(); | 401 << GetAndClearDebugLog(); |
| 390 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending()) | 402 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending()) |
| 391 << GetAndClearDebugLog(); | 403 << GetAndClearDebugLog(); |
| 392 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) | 404 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) |
| 393 << GetAndClearDebugLog(); | 405 << GetAndClearDebugLog(); |
| 394 break; | 406 break; |
| 395 case STATE_TAB_BROWSER_FULLSCREEN: | 407 case STATE_TAB_BROWSER_FULLSCREEN: |
| 396 #if defined(OS_MACOSX) | 408 #if defined(OS_MACOSX) |
| 397 EXPECT_FALSE(GetBrowser()->window()->InPresentationMode()) | 409 EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithChrome()) |
| 410 << GetAndClearDebugLog(); |
| 411 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome()) |
| 398 << GetAndClearDebugLog(); | 412 << GetAndClearDebugLog(); |
| 399 #endif | 413 #endif |
| 400 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser()) | 414 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser()) |
| 401 << GetAndClearDebugLog(); | 415 << GetAndClearDebugLog(); |
| 402 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending()) | 416 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForTabOrPending()) |
| 403 << GetAndClearDebugLog(); | 417 << GetAndClearDebugLog(); |
| 404 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) | 418 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) |
| 405 << GetAndClearDebugLog(); | 419 << GetAndClearDebugLog(); |
| 406 break; | 420 break; |
| 407 case STATE_TO_NORMAL: | 421 case STATE_TO_NORMAL: |
| 408 #if defined(OS_MACOSX) | 422 #if defined(OS_MACOSX) |
| 409 EXPECT_FALSE(GetBrowser()->window()->InPresentationMode()) | 423 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithChrome()) |
| 424 << GetAndClearDebugLog(); |
| 425 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome()) |
| 410 << GetAndClearDebugLog(); | 426 << GetAndClearDebugLog(); |
| 411 #endif | 427 #endif |
| 412 // No expectation for IsFullscreenForBrowser. | 428 // No expectation for IsFullscreenForBrowser. |
| 413 // No expectation for IsFullscreenForTabOrPending. | 429 // No expectation for IsFullscreenForTabOrPending. |
| 414 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) | 430 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) |
| 415 << GetAndClearDebugLog(); | 431 << GetAndClearDebugLog(); |
| 416 break; | 432 break; |
| 417 case STATE_TO_BROWSER_FULLSCREEN_NO_CHROME: | 433 case STATE_TO_BROWSER_FULLSCREEN_NO_CHROME: |
| 418 #if defined(OS_MACOSX) | 434 #if defined(OS_MACOSX) |
| 419 EXPECT_FALSE(GetBrowser()->window()->InPresentationMode()) | 435 // http://crbug.com/169138 - Fullscreen controller currently transitions |
| 436 // Mac into fullscreen with and without chrome differently than other |
| 437 // platforms, and the result is a name mismatch between the named |
| 438 // state_ and the window()->IsFullscreenWith...() methods. |
| 439 EXPECT_TRUE(GetBrowser()->window()->IsFullscreenWithChrome()) |
| 440 << GetAndClearDebugLog(); |
| 441 EXPECT_FALSE(GetBrowser()->window()->IsFullscreenWithoutChrome()) |
| 420 << GetAndClearDebugLog(); | 442 << GetAndClearDebugLog(); |
| 421 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser()) | 443 EXPECT_TRUE(GetFullscreenController()->IsFullscreenForBrowser()) |
| 422 << GetAndClearDebugLog(); | 444 << GetAndClearDebugLog(); |
| 423 #else | 445 #else |
| 424 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser()) | 446 EXPECT_FALSE(GetFullscreenController()->IsFullscreenForBrowser()) |
| 425 << GetAndClearDebugLog(); | 447 << GetAndClearDebugLog(); |
| 426 #endif | 448 #endif |
| 427 // No expectation for IsFullscreenForTabOrPending. | 449 // No expectation for IsFullscreenForTabOrPending. |
| 428 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) | 450 EXPECT_FALSE(GetFullscreenController()->IsInMetroSnapMode()) |
| 429 << GetAndClearDebugLog(); | 451 << GetAndClearDebugLog(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 << GetAndClearDebugLog(); | 625 << GetAndClearDebugLog(); |
| 604 | 626 |
| 605 debugging_log_ << " Then,\n"; | 627 debugging_log_ << " Then,\n"; |
| 606 ASSERT_TRUE(InvokeEvent(event)) << GetAndClearDebugLog(); | 628 ASSERT_TRUE(InvokeEvent(event)) << GetAndClearDebugLog(); |
| 607 } | 629 } |
| 608 | 630 |
| 609 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { | 631 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { |
| 610 return GetBrowser()->fullscreen_controller(); | 632 return GetBrowser()->fullscreen_controller(); |
| 611 } | 633 } |
| 612 | 634 |
| OLD | NEW |