| 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/exclusive_access/fullscreen_controller_state_test.h" | 5 #include "chrome/browser/ui/exclusive_access/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> |
| 11 | 11 |
| 12 #include "chrome/browser/fullscreen.h" | 12 #include "chrome/browser/fullscreen.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
| 15 #include "chrome/browser/ui/exclusive_access/exclusive_access_controller_manager
.h" |
| 15 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 16 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 16 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" | 17 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
| 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 18 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 bool SupportsMacSystemFullscreen() { | 25 bool SupportsMacSystemFullscreen() { |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 EXPECT_EQ(GetFullscreenController()->IsWindowFullscreenForTabOrPending(), | 745 EXPECT_EQ(GetFullscreenController()->IsWindowFullscreenForTabOrPending(), |
| 745 !!fullscreen_for_tab) << GetAndClearDebugLog(); | 746 !!fullscreen_for_tab) << GetAndClearDebugLog(); |
| 746 } | 747 } |
| 747 if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) { | 748 if (in_metro_snap != IN_METRO_SNAP_NO_EXPECTATION) { |
| 748 EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(), | 749 EXPECT_EQ(GetFullscreenController()->IsInMetroSnapMode(), |
| 749 !!in_metro_snap) << GetAndClearDebugLog(); | 750 !!in_metro_snap) << GetAndClearDebugLog(); |
| 750 } | 751 } |
| 751 } | 752 } |
| 752 | 753 |
| 753 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { | 754 FullscreenController* FullscreenControllerStateTest::GetFullscreenController() { |
| 754 return GetBrowser()->fullscreen_controller(); | 755 return GetBrowser() |
| 756 ->GetExclusiveAccessControllerManager() |
| 757 ->GetFullscreenController(); |
| 755 } | 758 } |
| 756 | 759 |
| 757 std::string FullscreenControllerStateTest::GetTransitionTableAsString() const { | 760 std::string FullscreenControllerStateTest::GetTransitionTableAsString() const { |
| 758 std::ostringstream output; | 761 std::ostringstream output; |
| 759 output << "transition_table_[NUM_STATES = " << NUM_STATES | 762 output << "transition_table_[NUM_STATES = " << NUM_STATES |
| 760 << "][NUM_EVENTS = " << NUM_EVENTS | 763 << "][NUM_EVENTS = " << NUM_EVENTS |
| 761 << "] =\n"; | 764 << "] =\n"; |
| 762 for (int state_int = 0; state_int < NUM_STATES; ++state_int) { | 765 for (int state_int = 0; state_int < NUM_STATES; ++state_int) { |
| 763 State state = static_cast<State>(state_int); | 766 State state = static_cast<State>(state_int); |
| 764 output << " { // " << GetStateString(state) << ":\n"; | 767 output << " { // " << GetStateString(state) << ":\n"; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 794 << std::right << std::setw(2) | 797 << std::right << std::setw(2) |
| 795 << info.distance | 798 << info.distance |
| 796 << " }, // " | 799 << " }, // " |
| 797 << GetStateString(state2) << "\n"; | 800 << GetStateString(state2) << "\n"; |
| 798 } | 801 } |
| 799 output << "},\n"; | 802 output << "},\n"; |
| 800 } | 803 } |
| 801 output << "};"; | 804 output << "};"; |
| 802 return output.str(); | 805 return output.str(); |
| 803 } | 806 } |
| OLD | NEW |