| 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> |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_ALLOW | 188 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_ALLOW |
| 189 #if defined(OS_MACOSX) | 189 #if defined(OS_MACOSX) |
| 190 // Mac window reports fullscreen immediately and an exit triggers exit. | 190 // Mac window reports fullscreen immediately and an exit triggers exit. |
| 191 STATE_TO_NORMAL, // Event BUBBLE_DENY | 191 STATE_TO_NORMAL, // Event BUBBLE_DENY |
| 192 #else | 192 #else |
| 193 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_DENY | 193 STATE_TO_TAB_FULLSCREEN, // Event BUBBLE_DENY |
| 194 #endif | 194 #endif |
| 195 STATE_TAB_FULLSCREEN, // Event WINDOW_CHANGE | 195 STATE_TAB_FULLSCREEN, // Event WINDOW_CHANGE |
| 196 }, | 196 }, |
| 197 }; | 197 }; |
| 198 COMPILE_ASSERT(sizeof(transition_table_data) == sizeof(transition_table_), | 198 static_assert(sizeof(transition_table_data) == sizeof(transition_table_), |
| 199 transition_table_incorrect_size); | 199 "transition_table has unexpected size"); |
| 200 memcpy(transition_table_, transition_table_data, | 200 memcpy(transition_table_, transition_table_data, |
| 201 sizeof(transition_table_data)); | 201 sizeof(transition_table_data)); |
| 202 | 202 |
| 203 // Verify that transition_table_ has been completely defined. | 203 // Verify that transition_table_ has been completely defined. |
| 204 for (int source = 0; source < NUM_STATES; ++source) { | 204 for (int source = 0; source < NUM_STATES; ++source) { |
| 205 for (int event = 0; event < NUM_EVENTS; ++event) { | 205 for (int event = 0; event < NUM_EVENTS; ++event) { |
| 206 EXPECT_NE(transition_table_[source][event], STATE_INVALID); | 206 EXPECT_NE(transition_table_[source][event], STATE_INVALID); |
| 207 EXPECT_GE(transition_table_[source][event], 0); | 207 EXPECT_GE(transition_table_[source][event], 0); |
| 208 EXPECT_LT(transition_table_[source][event], NUM_STATES); | 208 EXPECT_LT(transition_table_[source][event], NUM_STATES); |
| 209 } | 209 } |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 << std::right << std::setw(2) | 794 << std::right << std::setw(2) |
| 795 << info.distance | 795 << info.distance |
| 796 << " }, // " | 796 << " }, // " |
| 797 << GetStateString(state2) << "\n"; | 797 << GetStateString(state2) << "\n"; |
| 798 } | 798 } |
| 799 output << "},\n"; | 799 output << "},\n"; |
| 800 } | 800 } |
| 801 output << "};"; | 801 output << "};"; |
| 802 return output.str(); | 802 return output.str(); |
| 803 } | 803 } |
| OLD | NEW |